From 5aeafc0d87f2cbc8e30ba05802cbb45e941a1aca Mon Sep 17 00:00:00 2001 From: Marcel Folaron Date: Sat, 24 Aug 2024 01:22:29 -0400 Subject: [PATCH] Update ApiClientTest.php --- .../{ApiSessionTest.php => ApiClientTest.php} | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename tests/Unit/app/Core/{ApiSessionTest.php => ApiClientTest.php} (84%) diff --git a/tests/Unit/app/Core/ApiSessionTest.php b/tests/Unit/app/Core/ApiClientTest.php similarity index 84% rename from tests/Unit/app/Core/ApiSessionTest.php rename to tests/Unit/app/Core/ApiClientTest.php index 52297cd17d..db67ed7719 100644 --- a/tests/Unit/app/Core/ApiSessionTest.php +++ b/tests/Unit/app/Core/ApiClientTest.php @@ -3,10 +3,10 @@ namespace Test\Unit; use GuzzleHttp\HandlerStack; -use Leantime\Core\Http\Client\ApiSession; +use Leantime\Core\Http\Client\ApiClient; use PHPUnit\Framework\TestCase; -class ApiSessionTest extends TestCase +class ApiClientTest extends TestCase { public function testOAuth2(): void { @@ -14,7 +14,7 @@ public function testOAuth2(): void $stack = HandlerStack::create(); $requestDefaults = []; - $client = ApiSession::oAuth2($baseUri, $stack, $requestDefaults); + $client = ApiClient::oAuth2($baseUri, $stack, $requestDefaults); $this->assertEquals('http://test.com', $client->getConfig('base_uri')); $this->assertSame($stack, $client->getConfig('handler')); @@ -29,7 +29,7 @@ public function testOAuth2Grants(): void 'client_secret' => 'testsecret', ]; - $stack = ApiSession::oAuth2Grants($baseUri, $creds); + $stack = ApiClient::oAuth2Grants($baseUri, $creds); $this->assertInstanceOf(HandlerStack::class, $stack); } @@ -44,7 +44,7 @@ public function testOAuth1(): void 'token_secret' => 'testtokensecret', ]; - $client = ApiSession::oAuth1($baseUri, $creds); + $client = ApiClient::oAuth1($baseUri, $creds); $this->assertEquals('http://test.com', $client->getConfig('base_uri')); $this->assertEquals('oauth', $client->getConfig('auth')); @@ -58,7 +58,7 @@ public function testBasicAuth(): void 'password' => 'testpass', ]; - $client = ApiSession::basicAuth($baseUri, $creds); + $client = ApiClient::basicAuth($baseUri, $creds); $this->assertEquals('http://test.com', $client->getConfig('base_uri')); $this->assertEquals($creds, $client->getConfig('auth')); @@ -73,7 +73,7 @@ public function testDigest(): void 'digest' => 'testdigest', ]; - $client = ApiSession::digest($baseUri, $creds); + $client = ApiClient::digest($baseUri, $creds); $config = $client->getConfig(); $this->assertEquals('http://test.com', $config[1]['base_uri']); @@ -89,7 +89,7 @@ public function testNtlm(): void 'ntlm' => 'testntlm', ]; - $client = ApiSession::ntlm($baseUri, $creds); + $client = ApiClient::ntlm($baseUri, $creds); $this->assertEquals('http://test.com', $client->getConfig('base_uri')); $this->assertEquals($creds, $client->getConfig('auth'));