From 2d30fcc0acb7790d45f28b4c3b05da1fbbfc5727 Mon Sep 17 00:00:00 2001 From: Matias Vasquez Date: Thu, 6 Jun 2024 09:23:53 -0400 Subject: [PATCH] test: update request service test --- tests/RequestServiceTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/RequestServiceTest.php b/tests/RequestServiceTest.php index 196ed5cb..fb675e5f 100644 --- a/tests/RequestServiceTest.php +++ b/tests/RequestServiceTest.php @@ -12,18 +12,23 @@ class RequestServiceTest extends TestCase public function it_send_the_headers_provided_by_the_given_options() { $expectedHeaders = ['api_key' => 'commerce_code', 'api_secret' => 'fakeApiKey']; - + $timeOut = 10; $optionsMock = $this->createMock(Options::class); $optionsMock ->expects($this->once()) ->method('getHeaders') ->willReturn($expectedHeaders); + $optionsMock + ->expects($this->once()) + ->method('getTimeout') + ->willReturn($timeOut); $httpClientMock = $this->createMock(HttpClient::class); $httpClientMock ->expects($this->once()) ->method('request') - ->with($this->anything(), $this->anything(), $this->anything(), $this->equalTo(['headers' => $expectedHeaders,])) + ->with($this->anything(), $this->anything(), $this->anything(), $this->equalTo(['headers' => $expectedHeaders, + 'timeout' => $timeOut])) ->willReturn( new Response(200, [], json_encode(['token' => 'mock', 'url' => 'https://mock.cl/',])) );