$options = [
'timeout' => 10,
- 'headers' => ['Accept-Encoding' => 'gzip'],
];
if ($ETag !== '') {
- $options['headers']['If-None-Match'] = $ETag;
+ $options['headers'] = [
+ 'If-None-Match' => $ETag,
+ ];
}
$client = $this->clientService->newClient();
$client
->expects($this->once())
->method('get')
- ->with(
- $this->equalTo($this->endpoint),
- $this->equalTo([
- 'timeout' => 10,
- 'headers' => [
- 'Accept-Encoding' => 'gzip',
- ]
- ])
- )
+ ->with($this->endpoint)
->willReturn($response);
$response
->expects($this->once())
$client
->expects($this->once())
->method('get')
- ->with(
- $this->equalTo($this->endpoint),
- $this->equalTo([
- 'timeout' => 10,
- 'headers' => [
- 'Accept-Encoding' => 'gzip',
- ]
- ])
- )
+ ->with($this->endpoint)
->willReturn($response);
$response
->expects($this->once())
$client
->expects($this->once())
->method('get')
- ->with(
- $this->equalTo($this->endpoint),
- $this->equalTo([
- 'timeout' => 10,
- 'headers' => [
- 'Accept-Encoding' => 'gzip',
- ]
- ])
- )
+ ->with($this->endpoint)
->willReturn($response);
$response
->expects($this->once())
$client
->expects($this->once())
->method('get')
- ->with(
- $this->equalTo($this->endpoint),
- $this->equalTo([
- 'timeout' => 10,
- 'headers' => [
- 'Accept-Encoding' => 'gzip',
- ]
- ])
- )
+ ->with($this->endpoint)
->willThrowException(new \Exception());
$this->assertSame([], $this->fetcher->get());
$this->equalTo([
'timeout' => 10,
'headers' => [
- 'Accept-Encoding' => 'gzip',
- 'If-None-Match' => '"myETag"',
+ 'If-None-Match' => '"myETag"'
]
])
)->willReturn($response);
$this->equalTo([
'timeout' => 10,
'headers' => [
- 'Accept-Encoding' => 'gzip',
'If-None-Match' => '"myETag"',
]
])
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
- 'headers' => [
- 'Accept-Encoding' => 'gzip',
- ],
])
)
->willReturn($response);