Skip to content

Commit

Permalink
Update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Jun 21, 2023
1 parent bdc5740 commit 2f04bc8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/ConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

use Jenky\Atlas\ConnectorConfigurator;
use Jenky\Atlas\Middleware\Interceptor;
use Jenky\Atlas\Mock\MockClient;
use Jenky\Atlas\Mock\MockResponse;
use Jenky\Atlas\Mock\ScopingMockClient;
use Jenky\Atlas\NullConnector;
use Jenky\Atlas\Tests\Services\DummyRequest;
use Jenky\Atlas\Tests\Services\PostmanEcho\EchoConnector;
Expand Down Expand Up @@ -84,7 +85,13 @@ public function test_requests_resources(): void

public function test_connector_configurator(): void
{
$client = new MockClient();
$client = new ScopingMockClient([
'https://postman-echo.com/get' => [
MockResponse::create('', 503),
MockResponse::create('', 301, ['Location' => 'http://localhost']),
],
'*' => MockResponse::create(''),
]);

$connector = (new EchoConnector())->withClient($client);

Expand All @@ -96,5 +103,7 @@ public function test_connector_configurator(): void

$this->assertCount(0, $connector->middleware());
$this->assertSame(200, $response->status());

$client->assertSentCount(3);
}
}

0 comments on commit 2f04bc8

Please sign in to comment.