Skip to content

Commit

Permalink
API Stop using deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Nov 2, 2022
1 parent dce7e55 commit 848fa1e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/Auth/HandlerTest.php
Expand Up @@ -42,7 +42,7 @@ public function testRequireAuthenticationReturnsFalseWhenNoneAreConfigured()
*/
public function testRequireAuthenticationReturnsMember()
{
Handler::config()->update('authenticators', [
Handler::config()->merge('authenticators', [
['class' => PushoverAuthenticatorFake::class]
]);

Expand All @@ -55,7 +55,7 @@ public function testRequireAuthenticationReturnsMember()
*/
public function testGetAuthenticator()
{
Handler::config()->update('authenticators', [
Handler::config()->merge('authenticators', [
['class' => PushoverAuthenticatorFake::class]
]);

Expand All @@ -71,7 +71,7 @@ public function testExceptionThrownWhenAuthenticatorDoesNotImplementAuthenticato
{
$this->expectException(\SilverStripe\ORM\ValidationException::class);
$this->expectExceptionMessage('stdClass must implement SilverStripe\\GraphQL\\Auth\\AuthenticatorInterface!');
Handler::config()->update('authenticators', [['class' => 'stdClass']]);
Handler::config()->merge('authenticators', [['class' => 'stdClass']]);
$this->handler->getAuthenticator(new HTTPRequest('GET', '/'));
}

Expand All @@ -84,7 +84,7 @@ public function testExceptionThrownWhenAuthenticatorDoesNotImplementAuthenticato
*/
public function testAuthenticatorsCanBePrioritised($authenticators, $expected)
{
Handler::config()->update('authenticators', $authenticators);
Handler::config()->set('authenticators', $authenticators);

$this->assertInstanceOf($expected, $this->handler->getAuthenticator(new HTTPRequest('GET', '/')));
}
Expand Down Expand Up @@ -134,7 +134,7 @@ public function testFailedAuthenticationThrowsException()
{
$this->expectException(\SilverStripe\ORM\ValidationException::class);
$this->expectExceptionMessage('Never!');
Handler::config()->update('authenticators', [['class' => BrutalAuthenticatorFake::class]]);
Handler::config()->merge('authenticators', [['class' => BrutalAuthenticatorFake::class]]);
$this->handler->requireAuthentication(new HTTPRequest('/', 'GET'));
}

Expand All @@ -148,7 +148,7 @@ public function testFailedAuthenticationWithFalsyReturnValueThrowsDefaultExcepti
{
$this->expectException(\SilverStripe\ORM\ValidationException::class);
$this->expectExceptionMessage('Authentication failed.');
Handler::config()->update('authenticators', [['class' => FalsyAuthenticatorFake::class]]);
Handler::config()->merge('authenticators', [['class' => FalsyAuthenticatorFake::class]]);
$this->handler->requireAuthentication(new HTTPRequest('/', 'GET'));
}
}

0 comments on commit 848fa1e

Please sign in to comment.