-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
98 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ protected function setup(): void | |
|
||
'module.enable' => [ | ||
'casserver' => true, | ||
] | ||
], | ||
]); | ||
} | ||
|
||
|
@@ -124,8 +124,8 @@ public function testNoQueryParameters(): void | |
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
CURLOPT_FOLLOWLOCATION => true | ||
] | ||
CURLOPT_FOLLOWLOCATION => true, | ||
], | ||
); | ||
$this->assertEquals(200, $resp['code']); | ||
Check failure on line 130 in tests/public/LoginIntegrationTest.php
|
||
|
||
|
@@ -148,15 +148,15 @@ public function testWrongServiceUrl(): void | |
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
CURLOPT_FOLLOWLOCATION => true | ||
] | ||
CURLOPT_FOLLOWLOCATION => true, | ||
], | ||
); | ||
$this->assertEquals(500, $resp['code']); | ||
Check failure on line 154 in tests/public/LoginIntegrationTest.php
|
||
|
||
$this->assertStringContainsString( | ||
'CAS server is not listed as a legal service', | ||
$resp['body'], | ||
'Illegal cas service urls should be rejected' | ||
'Illegal cas service urls should be rejected', | ||
); | ||
} | ||
|
||
|
@@ -178,15 +178,15 @@ public function testValidServiceUrl(string $serviceParam, string $ticketParam): | |
[$serviceParam => $service_url], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
$this->assertEquals(303, $resp['code']); | ||
|
||
$this->assertStringStartsWith( | ||
$service_url . '?' . $ticketParam . '=ST-', | ||
$resp['headers']['Location'], | ||
'Ticket should be part of the redirect.' | ||
'Ticket should be part of the redirect.', | ||
); | ||
|
||
// Config ticket can be validated | ||
|
@@ -198,11 +198,11 @@ public function testValidServiceUrl(string $serviceParam, string $ticketParam): | |
[ | ||
$serviceParam => $service_url, | ||
'ticket' => $ticket, | ||
], | ||
], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
|
||
$expectedResponse = DOMDocumentFactory::fromFile( | ||
|
@@ -217,7 +217,7 @@ public function validServiceUrlProvider(): array | |
{ | ||
return [ | ||
['service', 'ticket'], | ||
['TARGET', 'SAMLart'] | ||
['TARGET', 'SAMLart'], | ||
]; | ||
} | ||
|
||
|
@@ -235,15 +235,15 @@ public function testValidTicketNameOverride(): void | |
['TARGET' => $service_url], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
$this->assertEquals(303, $resp['code']); | ||
|
||
$this->assertStringStartsWith( | ||
$service_url . '?myTicket=ST-', | ||
$resp['headers']['Location'], | ||
'Ticket should be part of the redirect.' | ||
'Ticket should be part of the redirect.', | ||
); | ||
} | ||
|
||
|
@@ -260,15 +260,15 @@ public function testDebugOutput(): void | |
['service' => $service_url, 'debugMode' => 'true'], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
$this->assertEquals(200, $resp['code']); | ||
|
||
$this->assertStringContainsString( | ||
'<cas:eduPersonPrincipalName>[email protected]</cas:eduPersonPrincipalName>', | ||
$resp['body'], | ||
'Attributes should have been printed.' | ||
'Attributes should have been printed.', | ||
); | ||
} | ||
|
||
|
@@ -285,16 +285,16 @@ public function testDebugOutputSamlValidate(): void | |
['service' => $service_url, 'debugMode' => 'samlValidate'], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
$this->assertEquals(200, $resp['code']); | ||
|
||
|
||
$this->assertStringContainsString( | ||
'[email protected]</NameIdentifier', | ||
$resp['body'], | ||
'Attributes should have been printed.' | ||
'Attributes should have been printed.', | ||
); | ||
} | ||
|
||
|
@@ -311,19 +311,19 @@ public function testAlternateServiceConfigUsed(): void | |
['service' => $service_url, 'debugMode' => 'true'], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
$this->assertEquals(200, $resp['code']); | ||
$this->assertStringContainsString( | ||
'<cas:user>testuser</cas:user>', | ||
$resp['body'], | ||
'cas:user attribute should have been overridden' | ||
'cas:user attribute should have been overridden', | ||
); | ||
$this->assertStringContainsString( | ||
'<cas:cn>Test User</cas:cn>', | ||
$resp['body'], | ||
'Attributes should have been printed with alternate attribute release' | ||
'Attributes should have been printed with alternate attribute release', | ||
); | ||
} | ||
|
||
|
@@ -344,8 +344,8 @@ public function testValidServiceUrlWithPost(): void | |
], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
|
||
// POST responds with a form that is uses JavaScript to submit | ||
|
@@ -372,12 +372,12 @@ public function testValidServiceUrlWithPost(): void | |
} | ||
$this->assertEquals( | ||
'ticket', | ||
$item->getAttribute('name') | ||
$item->getAttribute('name'), | ||
); | ||
$this->assertStringStartsWith( | ||
'ST-', | ||
$item->getAttribute('value'), | ||
'' | ||
'', | ||
); | ||
} | ||
|
||
|
@@ -394,15 +394,15 @@ public function testSamlValidate(): void | |
['service' => $service_url], | ||
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file | ||
] | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
], | ||
); | ||
$this->assertEquals(303, $resp['code']); | ||
|
||
$this->assertStringStartsWith( | ||
$service_url . '?ticket=ST-', | ||
$resp['headers']['Location'], | ||
'Ticket should be part of the redirect.' | ||
'Ticket should be part of the redirect.', | ||
); | ||
|
||
$location = $resp['headers']['Location']; | ||
|
@@ -425,7 +425,7 @@ public function testSamlValidate(): void | |
$soapRequest, | ||
[ | ||
'TARGET' => $service_url, | ||
] | ||
], | ||
); | ||
|
||
$this->assertEquals(200, $resp['code']); | ||
|
@@ -445,8 +445,8 @@ private function authenticate(): void | |
[ | ||
CURLOPT_COOKIEJAR => $this->cookies_file, | ||
CURLOPT_COOKIEFILE => $this->cookies_file, | ||
CURLOPT_FOLLOWLOCATION => true | ||
] | ||
CURLOPT_FOLLOWLOCATION => true, | ||
], | ||
); | ||
$this->assertEquals(200, $resp['code'], $resp['body']); | ||
} | ||
|
Oops, something went wrong.