@@ -35,8 +35,9 @@ function it_caches_responses(CacheItemPoolInterface $pool, CacheItemInterface $i
35
35
$ response ->getHeader ('Expires ' )->willReturn (array ());
36
36
37
37
$ pool ->getItem ('e3b717d5883a45ef9493d009741f7c64 ' )->shouldBeCalled ()->willReturn ($ item );
38
- $ item ->exists ()->willReturn (false );
39
- $ item ->set ($ response , 60 )->shouldBeCalled ();
38
+ $ item ->isHit ()->willReturn (false );
39
+ $ item ->set ($ response )->willReturn ($ item )->shouldBeCalled ();
40
+ $ item ->expiresAfter (60 )->willReturn ($ item )->shouldBeCalled ();
40
41
$ pool ->save ($ item )->shouldBeCalled ();
41
42
42
43
$ next = function (RequestInterface $ request ) use ($ response ) {
@@ -55,7 +56,7 @@ function it_doesnt_store_failed_responses(CacheItemPoolInterface $pool, CacheIte
55
56
$ response ->getHeader ('Expires ' )->willReturn (array ());
56
57
57
58
$ pool ->getItem ('e3b717d5883a45ef9493d009741f7c64 ' )->shouldBeCalled ()->willReturn ($ item );
58
- $ item ->exists ()->willReturn (false );
59
+ $ item ->isHit ()->willReturn (false );
59
60
60
61
$ next = function (RequestInterface $ request ) use ($ response ) {
61
62
return new FulfilledPromise ($ response ->getWrappedObject ());
@@ -87,10 +88,11 @@ function it_calculate_age_from_response(CacheItemPoolInterface $pool, CacheItemI
87
88
$ response ->getHeader ('Expires ' )->willReturn (array ());
88
89
89
90
$ pool ->getItem ('e3b717d5883a45ef9493d009741f7c64 ' )->shouldBeCalled ()->willReturn ($ item );
90
- $ item ->exists ()->willReturn (false );
91
+ $ item ->isHit ()->willReturn (false );
91
92
92
93
// 40-15 should be 25
93
- $ item ->set ($ response , 25 )->shouldBeCalled ();
94
+ $ item ->set ($ response )->willReturn ($ item )->shouldBeCalled ();
95
+ $ item ->expiresAfter (25 )->willReturn ($ item )->shouldBeCalled ();
94
96
$ pool ->save ($ item )->shouldBeCalled ();
95
97
96
98
$ next = function (RequestInterface $ request ) use ($ response ) {
0 commit comments