Skip to content

spec is not analyzed by styleci - but we should use short array syntax #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions spec/CachePluginSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ function it_caches_responses(CacheItemPoolInterface $pool, CacheItemInterface $i

$response->getStatusCode()->willReturn(200);
$response->getBody()->willReturn($stream);
$response->getHeader('Cache-Control')->willReturn(array())->shouldBeCalled();
$response->getHeader('Expires')->willReturn(array())->shouldBeCalled();
$response->getHeader('ETag')->willReturn(array())->shouldBeCalled();
$response->getHeader('Cache-Control')->willReturn([])->shouldBeCalled();
$response->getHeader('Expires')->willReturn([])->shouldBeCalled();
$response->getHeader('ETag')->willReturn([])->shouldBeCalled();

$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
$item->isHit()->willReturn(false);
Expand Down Expand Up @@ -77,8 +77,8 @@ function it_doesnt_store_failed_responses(CacheItemPoolInterface $pool, CacheIte
$request->getBody()->shouldBeCalled();

$response->getStatusCode()->willReturn(400);
$response->getHeader('Cache-Control')->willReturn(array());
$response->getHeader('Expires')->willReturn(array());
$response->getHeader('Cache-Control')->willReturn([]);
$response->getHeader('Expires')->willReturn([]);

$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
$item->isHit()->willReturn(false);
Expand Down Expand Up @@ -184,10 +184,10 @@ function it_calculate_age_from_response(CacheItemPoolInterface $pool, CacheItemI

$response->getStatusCode()->willReturn(200);
$response->getBody()->willReturn($stream);
$response->getHeader('Cache-Control')->willReturn(array('max-age=40'));
$response->getHeader('Age')->willReturn(array('15'));
$response->getHeader('Expires')->willReturn(array());
$response->getHeader('ETag')->willReturn(array());
$response->getHeader('Cache-Control')->willReturn(['max-age=40']);
$response->getHeader('Age')->willReturn(['15']);
$response->getHeader('Expires')->willReturn([]);
$response->getHeader('ETag')->willReturn([]);

$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
$item->isHit()->willReturn(false);
Expand Down Expand Up @@ -222,9 +222,9 @@ function it_saves_etag(CacheItemPoolInterface $pool, CacheItemInterface $item, R
$request->getUri()->willReturn('/');
$response->getStatusCode()->willReturn(200);
$response->getBody()->willReturn($stream);
$response->getHeader('Cache-Control')->willReturn(array());
$response->getHeader('Expires')->willReturn(array());
$response->getHeader('ETag')->willReturn(array('foo_etag'));
$response->getHeader('Cache-Control')->willReturn([]);
$response->getHeader('Expires')->willReturn([]);
$response->getHeader('ETag')->willReturn(['foo_etag']);

$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
$item->isHit()->willReturn(false);
Expand Down Expand Up @@ -317,8 +317,8 @@ function it_serves_and_resaved_expired_response(CacheItemPoolInterface $pool, Ca
$request->withHeader(Argument::any(), Argument::any())->willReturn($request);

$response->getStatusCode()->willReturn(304);
$response->getHeader('Cache-Control')->willReturn(array());
$response->getHeader('Expires')->willReturn(array())->shouldBeCalled();
$response->getHeader('Cache-Control')->willReturn([]);
$response->getHeader('Expires')->willReturn([])->shouldBeCalled();

// Make sure we add back the body
$response->withBody($stream)->willReturn($response)->shouldBeCalled();
Expand Down Expand Up @@ -377,8 +377,8 @@ function it_caches_private_responses_when_allowed(
$response->getStatusCode()->willReturn(200);
$response->getBody()->willReturn($stream);
$response->getHeader('Cache-Control')->willReturn(['private'])->shouldBeCalled();
$response->getHeader('Expires')->willReturn(array())->shouldBeCalled();
$response->getHeader('ETag')->willReturn(array())->shouldBeCalled();
$response->getHeader('Expires')->willReturn([])->shouldBeCalled();
$response->getHeader('ETag')->willReturn([])->shouldBeCalled();

$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
$item->isHit()->willReturn(false);
Expand Down