From 848fa1eb9410e33606417ca55bf95105492f71c8 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 2 Nov 2022 18:01:53 +1300 Subject: [PATCH] API Stop using deprecated API --- tests/Auth/HandlerTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Auth/HandlerTest.php b/tests/Auth/HandlerTest.php index c00c2b32..7a62b10e 100644 --- a/tests/Auth/HandlerTest.php +++ b/tests/Auth/HandlerTest.php @@ -42,7 +42,7 @@ public function testRequireAuthenticationReturnsFalseWhenNoneAreConfigured() */ public function testRequireAuthenticationReturnsMember() { - Handler::config()->update('authenticators', [ + Handler::config()->merge('authenticators', [ ['class' => PushoverAuthenticatorFake::class] ]); @@ -55,7 +55,7 @@ public function testRequireAuthenticationReturnsMember() */ public function testGetAuthenticator() { - Handler::config()->update('authenticators', [ + Handler::config()->merge('authenticators', [ ['class' => PushoverAuthenticatorFake::class] ]); @@ -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', '/')); } @@ -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', '/'))); } @@ -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')); } @@ -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')); } }