$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->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willReturn($response);
$response
->expects($this->once())
$client
->expects($this->once())
->method('get')
- ->with($this->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willReturn($response);
$response
->expects($this->once())
$client
->expects($this->once())
->method('get')
- ->with($this->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willReturn($response);
$response
->expects($this->once())
$client
->expects($this->once())
->method('get')
- ->with($this->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willThrowException(new \Exception());
$this->assertSame([], $this->fetcher->get());
$this->equalTo([
'timeout' => 10,
'headers' => [
- 'If-None-Match' => '"myETag"'
+ 'Accept-Encoding' => 'gzip',
+ '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);