lemonldap-ng/lemonldap-ng-portal/t
2019-11-25 11:55:19 +01:00
..
gpghome Add minimal Auth::GPG 2018-12-21 16:07:28 +01:00
lib Append unit test (#1956) 2019-10-13 22:30:40 +02:00
sessions SAML in progress (#595) 2016-11-22 20:55:10 +00:00
sessions2 Rename _loginHistory (#1169) 2017-03-21 21:00:37 +00:00
testslapd Add unit test and fix code for ppolicy grace (#1691) 2019-04-01 09:58:56 +02:00
01-AuthDemo.t Tydy 2019-05-11 20:18:43 +02:00
01-CSP-and-CORS-headers.t Send CORS headers when doing JSON responses too (#1765) 2019-09-16 16:55:15 +02:00
01-pdata.t tidy with new conf 2019-02-07 09:27:56 +01:00
02-Password-Demo-Local-Ppolicy.t Local password policy: minimal digits (#993) 2019-09-03 19:08:19 +02:00
02-Password-Demo.t New method to override messages with JSON files (#1595) 2019-03-19 17:39:13 +01:00
03-ConfTimeout.t Add timeout for configuration load (#1908) 2019-09-02 23:01:09 +02:00
03-SessionTimeout.t Fix test (#1908) 2019-09-02 23:18:25 +02:00
03-XSS-protection.t Typo 2019-07-17 11:58:22 +02:00
04-language-selection.t Tidy 2019-06-14 17:23:26 +02:00
19-Auth-Null.t tidy with new conf 2019-02-07 09:27:56 +01:00
20-Auth-and-password-DBI-dynamic-hash.t Parallel tests 2019-08-29 10:48:55 +02:00
20-Auth-and-password-DBI.t Parallel tests 2019-08-29 10:48:55 +02:00
20-Auth-DBI-utf8.t new expectJSON function in test-lib 2019-10-25 18:06:32 +02:00
21-Auth-and-password-LDAP.t Validate LDAP connections in getUser (#2018) 2019-11-20 20:57:33 +01:00
21-Auth-LDAP-Policy.t Fix some warnings in tests 2019-04-11 11:58:21 +02:00
21-Auth-LDAP-utf8.t tidy with new conf 2019-02-07 09:27:56 +01:00
22-Auth-and-password-AD.t tidy with new conf 2019-02-07 09:27:56 +01:00
23-Auth-and-password-REST.t tidy with new conf 2019-02-07 09:27:56 +01:00
24-AuthApache.t tidy with new conf 2019-02-07 09:27:56 +01:00
24-AuthKerberos.t tidy with new conf 2019-02-07 09:27:56 +01:00
25-AuthSlave-with-Choice.t Improve unit tests (#1935) 2019-09-15 19:39:27 +02:00
25-AuthSlave-with-Credentials.t Improve unit tests (#1935) 2019-09-15 19:39:27 +02:00
26-AuthRemote.t tidy with new conf 2019-02-07 09:27:56 +01:00
27-AuthProxy.t tidy with new conf 2019-02-07 09:27:56 +01:00
28-AuthChoice-and-password.t Parallel tests 2019-08-29 10:48:55 +02:00
28-AuthChoice-with-captcha.t Parallel tests 2019-08-29 10:48:55 +02:00
28-AuthChoice-with-over.t Add unit test for #1500 2019-10-01 14:50:22 +02:00
28-AuthChoice-with-rules.t Parallel tests 2019-08-29 10:48:55 +02:00
28-AuthChoice-with-token.t Tidy 2019-06-14 17:23:26 +02:00
29-AuthGPG.t Tydy 2019-05-11 20:18:43 +02:00
29-AuthSSL.t Parallel tests 2019-08-29 10:48:55 +02:00
30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-Metadata.t Tydy 2019-05-11 20:18:43 +02:00
30-Auth-and-issuer-SAML-POST-IdP-initiated.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-POST-Missing-SLO.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-POST.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-Redirect-MultipleSP.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-and-issuer-SAML-Redirect.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-Auth-SAML-with-choice.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-CDC.t Remove IDP cookie (#1941) 2019-10-17 23:09:03 +02:00
30-SAML-Head-to-Tail-POST.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-SAML-POST-Logout-when-expired.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
30-SAML-POST-with-2F-and-Notification.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-SAML-POST-with-Notification.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
30-SAML-ReAuth-with-choice.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
30-SAML-ReAuth.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
30-SAML-SP-rule.t Remove IDP cookie (#1941) 2019-10-17 23:09:03 +02:00
31-Auth-and-issuer-CAS-declared-app-userattr.t Typo 2019-09-18 21:01:24 +02:00
31-Auth-and-issuer-CAS-declared-app.t Typo 2019-09-18 21:01:24 +02:00
31-Auth-and-issuer-CAS-declared-apps.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
31-Auth-and-issuer-CAS-default.t Typo 2019-09-18 21:01:24 +02:00
31-Auth-and-issuer-CAS-gateway.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
31-Auth-and-issuer-CAS-Logout-20.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
31-Auth-and-issuer-CAS-Logout-30.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
31-Auth-and-issuer-CAS-proxied.t Typo 2019-09-18 21:01:24 +02:00
31-Auth-and-issuer-CAS-with-choice-and-cancel.t Parallel tests 2019-08-29 10:48:55 +02:00
31-Auth-and-issuer-CAS-with-choice.t Typo 2019-09-18 21:01:24 +02:00
31-Auth-and-issuer-CAS-XSS-on-logout.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t Merge branch 'remove-saml-idp-cookie-1941' into 'v2.0' 2019-10-30 16:01:11 +01:00
32-Auth-and-issuer-OIDC-authorization_code-public_client.t Merge branch 'remove-saml-idp-cookie-1941' into 'v2.0' 2019-10-30 16:01:11 +01:00
32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t Remove IDP cookie (#1941) 2019-10-17 23:09:03 +02:00
32-Auth-and-issuer-OIDC-authorization_code-with-none-alg.t Merge branch 'remove-saml-idp-cookie-1941' into 'v2.0' 2019-10-30 16:01:11 +01:00
32-Auth-and-issuer-OIDC-authorization_code.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
32-Auth-and-issuer-OIDC-hybrid.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
32-Auth-and-issuer-OIDC-implicit-no-token.t Manage claims in ID token if no access token requested (#1846) 2019-07-08 15:15:13 +02:00
32-Auth-and-issuer-OIDC-implicit.t Manage claims in ID token if no access token requested (#1846) 2019-07-08 15:15:13 +02:00
32-Auth-and-issuer-OIDC-sorted.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
32-CAS-10.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
32-OIDC-Offline-Session.t Add an option to return claims in ID token 2019-11-04 18:27:28 +01:00
32-OIDC-Refresh-Token.t Merge branch 'unit-tests-fake-time' into 'v2.0' 2019-11-04 20:37:07 +01:00
32-OIDC-RP-rule.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
32-OIDC-Token-Introspection.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
32-OIDC-Token-Security.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
33-Auth-and-issuer-OpenID2.t Clean tests (#1819) 2019-06-26 13:17:26 +02:00
34-Auth-Proxy-and-REST-Server.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
34-Auth-Proxy-and-SOAP-Server.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
35-My-session.t Verify "mysession" (#970) 2017-03-06 16:43:06 +00:00
35-REST-config-backend.t Fix REST service (#1870) 2019-08-17 17:11:28 +02:00
35-REST-export-password.t Clean tests (#1819) 2019-06-26 13:17:26 +02:00
35-REST-sessions-with-AuthBasic-handler.t Parallel tests 2019-08-29 10:48:55 +02:00
35-REST-sessions-with-REST-server.t Clean tests (#1819) 2019-06-26 13:17:26 +02:00
35-SOAP-config-backend.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
35-SOAP-sessions-with-SOAP-server.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
36-Combination-Kerberos-or-Demo.t Parallel tests 2019-08-29 10:48:55 +02:00
36-Combination-with-Choice.t Parallel tests 2019-08-29 10:48:55 +02:00
36-Combination-with-over.t Parallel tests 2019-08-29 10:48:55 +02:00
36-Combination-with-token.t tests: make expectReject more flexible 2019-08-29 18:51:23 +02:00
36-Combination-with-TOTP.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
36-Combination.t Parallel tests 2019-08-29 10:48:55 +02:00
37-CAS-App-to-SAML-IdP-POST-with-WAYF.t Remove IDP cookie (#1941) 2019-10-17 23:09:03 +02:00
37-CAS-App-to-SAML-IdP-POST.t Remove IDP cookie (#1941) 2019-10-17 23:09:03 +02:00
37-Logout-from-OIDC-RP-to-SAML-SP.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
37-OIDC-RP-to-SAML-IdP-GET.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
37-OIDC-RP-to-SAML-IdP-POST.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
37-SAML-SP-GET-to-OIDC-OP.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
37-SAML-SP-POST-to-CAS-server-with-Choice.t Remove IDP cookie (#1941) 2019-10-17 23:09:03 +02:00
37-SAML-SP-POST-to-CAS-server.t Remove IDP cookie (#1941) 2019-10-17 23:09:03 +02:00
37-SAML-SP-POST-to-OIDC-OP.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
38-No-persistent-session.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
40-Notifications-JSON-DBI.t Check only active notifications & Improve unit test - JSON format (#2012) 2019-11-25 11:51:08 +01:00
40-Notifications-JSON-File-with-token.t Parallel tests 2019-08-29 10:48:55 +02:00
40-Notifications-JSON-File.t Parallel tests 2019-08-29 10:48:55 +02:00
40-Notifications-JSON-Server.t Improve unit test (#2012) 2019-11-15 22:08:28 +01:00
40-Notifications-XML-DBI.t Check only active notifications & Improve unit test - XML format (#2012) 2019-11-25 11:55:19 +01:00
40-Notifications-XML-File.t Parallel tests 2019-08-29 10:48:55 +02:00
40-Notifications-XML-Server.t Parallel tests 2019-08-29 10:48:55 +02:00
41-Captcha.t Fix unit text (#1949) 2019-09-26 21:30:24 +02:00
41-Token-Global-Storage.t Add security test (#1742) 2019-05-11 15:56:17 +02:00
41-Token.t Forbid browsers to store users password & Improve unit tests (#1913) 2019-09-08 19:28:28 +02:00
42-Register-Demo-with-captcha.t make tidy with perltidy-20181120 2019-07-02 20:03:40 +02:00
42-Register-Demo-with-token.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
42-Register-Demo.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
42-Register-LDAP.t tidy with new conf 2019-02-07 09:27:56 +01:00
42-Register-Security.t Fix Perl dependencies (see RT#129960) 2019-07-02 08:56:12 +02:00
43-MailPasswordReset-Choice.t Parallel tests 2019-08-29 10:48:55 +02:00
43-MailPasswordReset-Combination-LDAP.t Unit test for Mail password reset + Combination + LDAP (#1903) 2019-09-09 16:23:50 +02:00
43-MailPasswordReset-DBI.t Parallel tests 2019-08-29 10:48:55 +02:00
43-MailPasswordReset-LDAP.t tidy with new conf 2019-02-07 09:27:56 +01:00
43-MailPasswordReset-with-captcha.t tidy with new conf 2019-02-07 09:27:56 +01:00
43-MailPasswordReset-with-token.t Tydy 2019-05-11 20:18:43 +02:00
43-MailPasswordReset.t Disable template cache to avoid translation issues in mail (#1897) 2019-08-27 23:13:36 +02:00
50-IssuerGet.t Please use our .perltidyrc 2019-03-07 18:22:58 +01:00
57-GlobalLogout-without-Timer.t Append unit tests (#1999) 2019-11-15 18:59:11 +01:00
57-GlobalLogout.t Update response and unit test (#1999) 2019-11-15 21:49:01 +01:00
58-DecryptValue-with-custom-function.t Typo (#1956) 2019-10-13 22:38:46 +02:00
58-DecryptValue-with-internal-function.t Typo (#1956) 2019-10-13 22:38:46 +02:00
59-Double-cookies-for-a-Single-session.t Improve cryptographic functions (#1823) 2019-06-28 10:30:37 +02:00
59-Double-cookies-for-Double-sessions.t Improve unit tests (#1775) 2019-05-27 22:42:02 +02:00
59-Double-cookies-Refresh-and-Logout.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
59-Secured-cookie-Refresh-and-Logout.t Tidy 2019-06-14 17:23:26 +02:00
60-Status.t tidy with new conf 2019-02-07 09:27:56 +01:00
61-BruteForceProtection.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
61-ForceAuthn.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
61-GrantSession.t Adapt GrantSession plugin to display authentication error on login form (#1666) 2019-03-18 11:53:30 +01:00
61-Session-ActivityTimeout.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
61-Session-Timeout.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
62-SingleSession.t tidy with new conf 2019-02-07 09:27:56 +01:00
62-UpgradeSession.t debug -> error 2019-10-29 22:21:58 +01:00
63-History.t tidy with new conf 2019-02-07 09:27:56 +01:00
64-StayConnected.t tidy with new conf 2019-02-07 09:27:56 +01:00
65-AutoSignin.t tidy with new conf 2019-02-07 09:27:56 +01:00
66-CDA-already-auth.t Clear url pdata on CDA redirection 2019-03-19 19:15:47 +01:00
66-CDA-PSGI-Try.t Render CDA compatible with Try (Fixes: #1849) 2019-07-10 10:40:32 +02:00
66-CDA-with-REST.t tidy with new conf 2019-02-07 09:27:56 +01:00
66-CDA-with-SOAP.t tidy with new conf 2019-02-07 09:27:56 +01:00
66-CDA.t tidy with new conf 2019-02-07 09:27:56 +01:00
67-CheckUser-with-Global-token.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
67-CheckUser-with-Impersonation-and-whatToTrace.t Improve unit test (#1938) 2019-11-13 19:22:45 +01:00
67-CheckUser-with-issuer-SAML-POST.t Fix cookie removal on SAML logout (#2001) 2019-11-06 18:44:10 +01:00
67-CheckUser-with-token.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
67-CheckUser.t Improve unit test (#1996) 2019-11-08 21:18:35 +01:00
68-ContextSwitching-with-Logout.t Improve unit test (#1783) 2019-11-12 22:16:31 +01:00
68-ContextSwitching.t Improve unit test & fix warning - Expired sessions (#1783) 2019-07-06 23:00:24 +02:00
68-Impersonation-with-doubleCookies.t Fix unit tests 2019-07-06 23:27:45 +02:00
68-Impersonation-with-filtered-merge.t Improve displaying checkuser template and rewrite tests #1806 2019-06-17 14:56:31 +02:00
68-Impersonation-with-History.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
68-Impersonation-with-merge.t Improve displaying checkuser template and rewrite tests #1806 2019-06-17 14:56:31 +02:00
68-Impersonation-with-TOTP.t Improve displaying checkuser template and rewrite tests #1806 2019-06-17 14:56:31 +02:00
68-Impersonation.t Fix unit tests 2019-07-06 23:27:45 +02:00
70-2F-TOTP-8.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
70-2F-TOTP-with-History.t Append unit test (#1632) 2019-02-16 22:00:25 +01:00
70-2F-TOTP-with-TTL-and-JSON.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
70-2F-TOTP-with-TTL-and-XML.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
70-2F-TOTP-with-TTL.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
71-2F-U2F-with-History.t Append unit test (#1632) 2019-02-16 22:00:25 +01:00
71-2F-U2F-with-TTL-and-msg.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
71-2F-U2F-with-TTL.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
71-2F-U2F.t Improve unit tests (#1796) 2019-06-14 23:11:10 +02:00
72-2F-REST-with-History.t Pass skin parameter in 2F flows (#1915) 2019-09-03 11:56:48 +02:00
73-2F-UTOTP-TOTP-and-U2F-with-History.t Append unit test (#1632) 2019-02-16 22:00:25 +01:00
73-2F-UTOTP-TOTP-and-U2F.t tidy with new conf 2019-02-07 09:27:56 +01:00
73-2F-UTOTP-TOTP-only-with-History.t Append unit test (#1632) 2019-02-16 22:00:25 +01:00
73-2F-UTOTP-TOTP-only.t tidy with new conf 2019-02-07 09:27:56 +01:00
74-2F-Required.t tidy with new conf 2019-02-07 09:27:56 +01:00
75-2F-Registers.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
76-2F-Ext-with-BruteForce.t Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
76-2F-Ext-with-CodeActivation.t Pass skin parameter in 2F flows (#1915) 2019-09-03 11:56:48 +02:00
76-2F-Ext-with-GrantSession.t Pass skin parameter in 2F flows (#1915) 2019-09-03 11:56:48 +02:00
76-2F-Ext-with-History.t Pass skin parameter in 2F flows (#1915) 2019-09-03 11:56:48 +02:00
77-2F-Extra.t Pass skin parameter in 2F flows (#1915) 2019-09-03 11:56:48 +02:00
77-2F-Mail-with-global-storage.t Pass skin parameter in 2F flows (#1915) 2019-09-03 11:56:48 +02:00
77-2F-Mail.t Pass skin parameter in 2F flows (#1915) 2019-09-03 11:56:48 +02:00
78-2F-Upgrade.t Append missing parameters & improve unit test (#1989) 2019-10-27 21:13:25 +01:00
90-Translations.t Add missing Finnish flag 2019-05-24 15:18:49 +02:00
99-Dont-load-Dumper.t Update unit test (#1956) 2019-10-01 19:55:48 +02:00
99-pod.t
lmConf-1.json Improve unit test (#1996) 2019-11-08 21:18:35 +01:00
pdata.pm make tidy 2018-07-05 23:00:40 +02:00
README.md Remove trailing whitespaces 2019-04-03 14:15:16 +02:00
saml-lib.pm Group SAML tests (#595) 2017-03-15 06:29:44 +00:00
sendCode.pl Please use our .perltidyrc 2019-03-07 18:22:58 +01:00
sendOTP.pl make tidy 2018-10-12 10:04:03 +02:00
separate-handler.pm Tydy 2019-05-11 20:18:43 +02:00
smtp.pm Replace MIME::Lite by Email::Sender/MIME::Entity (#1206) 2017-03-27 05:22:08 +00:00
test-ldap.pm Validate LDAP connections in getUser (#2018) 2019-11-20 20:57:33 +01:00
test-lib.pm Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
test-psgi.pm tidy with new conf 2019-02-07 09:27:56 +01:00
Time-Fake.pm Use Time::Fake to avoid sleeping during tests 2019-11-04 18:11:32 +01:00
vrfyOTP.pl make tidy 2018-10-12 10:04:03 +02:00

NAME

test-lib.pm - Test framework for LLNG portal

SYNOPSIS

use Test::More;
use strict;
use IO::String;

require 't/test-lib.pm';

my $res;

my $client = LLNG::Manager::Test->new( {
    ini => {
        logLevel => 'error',
        #...
    }
  }
);

ok(
    $res = $client->_post(
        '/',
        IO::String->new('user=dwho&password=dwho'),
        length => 23
    ),
    'Auth query'
);
count(1);
expectOK($res);
my $id = expectCookie($res);

clean_sessions();
done_testing( count() );

DESCRIPTION

This test library permits to simulate browser navigation.

Functions

In these functions, $res is the result of a LLNG::Manager::Test::_get() or LLNG::Manager::Test::_post() call (see below).

count($inc)

Returns number of tests done. Increment test number if an argument is given

explain( $result, $expected_result )

Used to display error if test fails:

ok( $res->[0] == 302, 'Get redirection' ) or
  explain( $res->[0], 302 );

clean_sessions()

Clean sessions created during tests

expectRedirection( $res, $location )

Verify that request result is a redirection to $location. $location can be:

  • a string: location must match exactly

  • a regexp: location must match this regexp. In this case, the list of matching strings are returned. Example:

      my( $uri, $query ) = expectRedirection( $res, qr#http://host(/[^\?]*)?(.*)$# );
    

expectAutoPost(@args)

Same behaviour as expectForm() but verify also that form method is post.

TODO: verify javascript

expectForm( $res, $hostRe, $uriRe, @requiredFields )

Verify form in HTML result and return ( $host, $uri, $query, $method ):

  • verify that a GET/POST form exists
  • if a $hostRe regexp is given, verify that form target matches and populates $host. Skipped if $hostRe eq "#"
  • if a $uriRe regexp is given, verify that form target matches and populates $uri
  • if @requiredFields exists, verify that each element is an input name
  • build form-url-encoded string looking at parameters/values and store it in $query

expectAuthenticatedAs($user)

Verify that result has a Lm-Remote-User header and value is $user

expectOK($res)

Verify that returned code is 200

expectBadRequest($res)

Verify that returned code is 400. Note that it works only for Ajax request (see below).

expectReject( $res, $code )

Verify that returned code is 401 and JSON result contains error:"$code". Note that it works only for Ajax request (see below).

expectCookie( $res, $cookieName )

Check if a Set-Cookie exists and set a cookie named $cookieName. Return its value.

exceptCspFormOK( $res, $host )

Verify that Content-Security-Policy header allows to connect to $host.

getCookies($res)

Returns an hash ref with names => values of cookies set by server.

getHeader( $res, $hname )

Returns value of first header named $hname in $res response.

getRedirection($res)

Returns value of Location header.

getUser($res)

Returns value of Lm-Remote-User header.

LLNG::Manager::Test Class

Accessors

  • app: built application
  • class: class to test (default Lemonldap::NG::Portal::Main)
  • p: portal object
  • ini: initialization parameters ($defaultIni values + given parameters)

Methods

logout($id)

Launch a /?logout=1 request an test:

  • if response is 200
  • if cookie 'lemonldap' and 'lemonldappdata' have no value
  • if a GET request with previous cookie value ($i) is rejected

_get( $path, %args )

Simulates a GET requests to $path. Accepted arguments:

  • accept: accepted content, default to Ajax request. Use 'text/html' to test content (to launch a expectForm() for example).
  • cookie: full cookie string
  • custom: additional headers (hash ref only)
  • ip: remote address. Default to 127.0.0.1
  • method: default to GET. Only GET/DELETE values are acceptable (use _post() if you want to launch a POST/PUT request)
  • query: query string
  • referer
  • remote_user: REMOTE_USER header value

_post( $path, $body, %args )

Same as _get except that a body is required. $body must be a file handle. Example with IO::String:

ok(
    $res = $client->_post(
        '/',
        IO::String->new('user=dwho&password=dwho'),
        length => 23
    ),
    'Auth query'
);

_delete( $path, %args )

Call _get() with method set to DELETE.

_put( $path, $body, %args )

Call _post() with method set to PUT