diff --git a/docker-compose.yml b/docker-compose.yml index ecbca334..6b9c1459 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,5 @@ services: command: vendor/bin/phpunit --testsuite "Zendesk API Unit Test Suites" # command: vendor/bin/phpunit --filter testExceptionsRetry tests/Zendesk/API/UnitTests/Middleware/RetryHandlerTest.php - volumes: vendor: diff --git a/tests/Zendesk/API/UnitTests/Middleware/RetryHandlerTest.php b/tests/Zendesk/API/UnitTests/Middleware/RetryHandlerTest.php index 790de436..71a30b12 100644 --- a/tests/Zendesk/API/UnitTests/Middleware/RetryHandlerTest.php +++ b/tests/Zendesk/API/UnitTests/Middleware/RetryHandlerTest.php @@ -26,25 +26,24 @@ class RetryHandlerTest extends BasicTest * * @dataProvider requestExceptionsProvider */ - // TODO - // public function testExceptionsRetry($exception, $success) - // { - // $config = [ - // 'max' => 1, - // 'exceptions' => [ServerException::class, ClientException::class], - // 'retry_if' => function () { - // return false; - // } - // ]; - // $client = $this->mockApiResponses([ - // new $exception('', new Request('GET', '')), - // new Response(200), - // ], ['handlers' => [ - // new RetryHandler($config) - // ]]); - - // $this->checkRequest($client, $success, $exception); - // } + public function testExceptionsRetry($exception, $success) + { + $config = [ + 'max' => 1, + 'exceptions' => [ServerException::class, ClientException::class], + 'retry_if' => function () { + return false; + } + ]; + $client = $this->mockApiResponses([ + new $exception('', new Request('GET', ''), new Response()), + new Response(200), + ], ['handlers' => [ + new RetryHandler($config) + ]]); + + $this->checkRequest($client, $success, $exception); + } /** * Samples for testExceptionsRetry @@ -56,7 +55,7 @@ public function requestExceptionsProvider() return [ [ServerException::class, true], [ClientException::class, true], - [ConnectException::class, false], + // TODO: [ConnectException::class, false], [TooManyRedirectsException::class, false] ]; }