Release 2.12 (#4609)

This commit is contained in:
Kevin Papst
2024-02-07 23:47:25 +01:00
committed by GitHub
parent 7abe787778
commit 85a16a9363
394 changed files with 1189 additions and 6735 deletions

View File

@@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase;
*/
class SamlBadgeTest extends TestCase
{
public function testConstruct()
public function testConstruct(): void
{
$attributes = new SamlLoginAttributes();
$sut = new SamlBadge($attributes);

View File

@@ -25,7 +25,7 @@ use Symfony\Component\Security\Http\Event\LogoutEvent;
*/
class SamlLogoutSubscriberTest extends TestCase
{
public function testLogout()
public function testLogout(): void
{
$auth = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock();
$auth->expects($this->once())->method('processSLO')->willThrowException(new Error('blub'));
@@ -41,7 +41,7 @@ class SamlLogoutSubscriberTest extends TestCase
$sut->logout(new LogoutEvent($request, $token));
}
public function testLogoutWithWrongTokenWillNotCallMethods()
public function testLogoutWithWrongTokenWillNotCallMethods(): void
{
$auth = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock();
$auth->expects($this->never())->method('processSLO');
@@ -57,7 +57,7 @@ class SamlLogoutSubscriberTest extends TestCase
$sut->logout(new LogoutEvent($request, $token));
}
public function testLogoutWithLogoutUrl()
public function testLogoutWithLogoutUrl(): void
{
$auth = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock();
$auth->expects($this->once())->method('processSLO')->willThrowException(new Error('blub'));

View File

@@ -62,7 +62,7 @@ class SamlProviderTest extends TestCase
return $provider;
}
public function testFindUserHydratesUser()
public function testFindUserHydratesUser(): void
{
$user = new User();
$user->setAuth(User::AUTH_INTERNAL);
@@ -86,7 +86,7 @@ class SamlProviderTest extends TestCase
self::assertEquals('foo@example.com', $tokenUser->getEmail());
}
public function testFindUserCreatesNewUser()
public function testFindUserCreatesNewUser(): void
{
$token = new SamlLoginAttributes();
$token->setUserIdentifier('foo2@example.com');
@@ -104,7 +104,7 @@ class SamlProviderTest extends TestCase
self::assertEquals('foo@example.com', $tokenUser->getEmail());
}
public function testAuthenticateThrowsAuthenticationException()
public function testAuthenticateThrowsAuthenticationException(): void
{
$this->expectException(AuthenticationException::class);
$this->expectExceptionMessage('Failed creating or hydrating user "foo1@example.com": Missing user attribute: Email');

View File

@@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase;
*/
class SamlTokenTest extends TestCase
{
public function testConstruct()
public function testConstruct(): void
{
$user = new User();
$user->setUserIdentifier('foo');

View File

@@ -22,7 +22,7 @@ use Symfony\Component\Security\Http\HttpUtils;
*/
class SamlAuthenticationSuccessHandlerTest extends TestCase
{
public function testWithAlwaysUseDefaultTargetPath()
public function testWithAlwaysUseDefaultTargetPath(): void
{
$httpUtils = new HttpUtils($this->getUrlGenerator());
$handler = new SamlAuthenticationSuccessHandler($httpUtils, ['always_use_default_target_path' => true]);
@@ -32,7 +32,7 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase
$this->assertTrue($response->isRedirect($defaultTargetPath));
}
public function testRelayState()
public function testRelayState(): void
{
$handler = new SamlAuthenticationSuccessHandler(new HttpUtils($this->getUrlGenerator()), ['always_use_default_target_path' => false]);
$response = $handler->onAuthenticationSuccess($this->getRequest('/sso/login', 'http://localhost/relayed'), $this->getSamlToken());
@@ -40,7 +40,7 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase
$this->assertTrue($response->isRedirect('http://localhost/relayed'));
}
public function testWithoutRelayState()
public function testWithoutRelayState(): void
{
$httpUtils = new HttpUtils($this->getUrlGenerator());
$handler = new SamlAuthenticationSuccessHandler($httpUtils, ['always_use_default_target_path' => false]);
@@ -50,7 +50,7 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase
$this->assertTrue($response->isRedirect($defaultTargetPath));
}
public function testRelayStateLoop()
public function testRelayStateLoop(): void
{
$httpUtils = new HttpUtils($this->getUrlGenerator());
$handler = new SamlAuthenticationSuccessHandler($httpUtils, ['always_use_default_target_path' => false]);