Skip to content

Commit

Permalink
Merge pull request #505 from creative-commoners/pulls/4/stop-depr
Browse files Browse the repository at this point in the history
API Stop using deprecated API
  • Loading branch information
sabina-talipova authored Nov 13, 2022
2 parents 1cb2e6c + 848fa1e commit d9bda2b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/Auth/HandlerTest.php
Original file line number Diff line number Diff line change
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 d9bda2b

Please sign in to comment.