From 55d82132eafe3375800c85ac9af37dde88e552f5 Mon Sep 17 00:00:00 2001 From: smiley Date: Wed, 6 Mar 2024 21:46:02 +0100 Subject: [PATCH] :shower: --- tests/Providers/OAuthAPITestAbstract.php | 2 +- tests/Providers/OAuthProviderTestAbstract.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/Providers/OAuthAPITestAbstract.php b/tests/Providers/OAuthAPITestAbstract.php index f3220621..219d2239 100644 --- a/tests/Providers/OAuthAPITestAbstract.php +++ b/tests/Providers/OAuthAPITestAbstract.php @@ -72,7 +72,7 @@ protected function initStorage(SettingsContainerInterface $options):OAuthStorage return new OAuthTestMemoryStorage($options, $this->CFG); } - protected function initHttp(SettingsContainerInterface $options, LoggerInterface $logger, array $responses):ClientInterface{ + protected function initHttp(SettingsContainerInterface $options, LoggerInterface $logger):ClientInterface{ return new OAuthTestHttpClient($this->CFG, $logger); } diff --git a/tests/Providers/OAuthProviderTestAbstract.php b/tests/Providers/OAuthProviderTestAbstract.php index 5bd90d30..454d5802 100644 --- a/tests/Providers/OAuthProviderTestAbstract.php +++ b/tests/Providers/OAuthProviderTestAbstract.php @@ -33,8 +33,8 @@ abstract class OAuthProviderTestAbstract extends TestCase{ protected bool $is_ci; // PSR interfaces - protected ClientInterface $http; - protected LoggerInterface $logger; + protected ClientInterface $http; + protected LoggerInterface $logger; // OAuth related properties protected OAuthOptions|SettingsContainerInterface $options; @@ -58,10 +58,10 @@ protected function setUp():void{ // init provider $this->options = $this->initOptions(); $this->storage = $this->initStorage($this->options); - $this->http = $this->initHttp($this->options, $this->logger, $this::TEST_RESPONSES); // PSR-18 HTTP client + $this->http = $this->initHttp($this->options, $this->logger); // PSR-18 HTTP client $this->provider = $this->initProvider($this->getProviderFQCN()); - $this->initTestProperties($this::TEST_PROPERTIES); + $this->initTestProperties(); } /** @@ -97,8 +97,8 @@ protected function initStorage(SettingsContainerInterface $options):OAuthStorage return new MemoryStorage($options); } - protected function initHttp(SettingsContainerInterface $options, LoggerInterface $logger, array $responses):ClientInterface{ - return new ProviderTestHttpClient($logger, $responses); + protected function initHttp(SettingsContainerInterface $options, LoggerInterface $logger):ClientInterface{ + return new ProviderTestHttpClient($logger, $this::TEST_RESPONSES); } protected function initProvider(string $FQCN):OAuthInterface|OAuth1Interface|OAuth2Interface{ @@ -117,9 +117,9 @@ protected function initProvider(string $FQCN):OAuthInterface|OAuth1Interface|OAu return $this->reflection->newInstanceArgs($args); } - protected function initTestProperties(array $properties):void{ - foreach($properties as $property => $value){ - $this->reflection->getProperty($property)->setValue($this->provider, $value); + protected function initTestProperties():void{ + foreach($this::TEST_PROPERTIES as $property => $value){ + $this->setReflectionProperty($property, $value); } }