Upgrade tests to PhpUnit 10 (#5252)

This commit is contained in:
Kevin Papst
2024-12-22 01:25:30 +01:00
committed by GitHub
parent 9bd37fb695
commit c7f0508707
377 changed files with 3308 additions and 3409 deletions

View File

@@ -27,8 +27,8 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase
{
$handler = new SamlAuthenticationSuccessHandler(new HttpUtils($this->getUrlGenerator()));
$response = $handler->onAuthenticationSuccess($this->getRequest('/sso/login', 'http://localhost/relayed'), $this->getSamlToken());
$this->assertInstanceOf(RedirectResponse::class, $response);
$this->assertTrue($response->isRedirect('http://localhost/relayed'));
self::assertInstanceOf(RedirectResponse::class, $response);
self::assertTrue($response->isRedirect('http://localhost/relayed'));
}
public function testWithoutRelayState(): void
@@ -37,8 +37,8 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase
$handler = new SamlAuthenticationSuccessHandler($httpUtils);
$defaultTargetPath = $httpUtils->generateUri($this->getRequest('/sso/login'), '/');
$response = $handler->onAuthenticationSuccess($this->getRequest(), $this->getSamlToken());
$this->assertInstanceOf(RedirectResponse::class, $response);
$this->assertTrue($response->isRedirect($defaultTargetPath));
self::assertInstanceOf(RedirectResponse::class, $response);
self::assertTrue($response->isRedirect($defaultTargetPath));
}
public function testRelayStateLoop(): void
@@ -47,8 +47,8 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase
$handler = new SamlAuthenticationSuccessHandler($httpUtils);
$loginPath = $httpUtils->generateUri($this->getRequest('/sso/login'), '/login');
$response = $handler->onAuthenticationSuccess($this->getRequest($loginPath), $this->getSamlToken());
$this->assertInstanceOf(RedirectResponse::class, $response);
$this->assertTrue(!$response->isRedirect($loginPath));
self::assertInstanceOf(RedirectResponse::class, $response);
self::assertTrue(!$response->isRedirect($loginPath));
}
private function getUrlGenerator(): UrlGeneratorInterface
@@ -57,9 +57,9 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase
$urlGenerator
->expects($this->any())
->method('generate')
->will($this->returnCallback(function ($name) {
->willReturnCallback(function ($name) {
return (string) $name;
}))
})
;
return $urlGenerator;