| @@ 28-39 (lines=12) @@ | ||
| 25 | ); |
|
| 26 | } |
|
| 27 | ||
| 28 | public function testSetSharedMaxAge() |
|
| 29 | { |
|
| 30 | $configurator = new ResponseCacheConfigurator(); |
|
| 31 | ||
| 32 | $response = new Response(); |
|
| 33 | $configurator->setSharedMaxAge($response, 30); |
|
| 34 | ||
| 35 | self::assertEquals( |
|
| 36 | 30, |
|
| 37 | $response->headers->getCacheControlDirective('s-maxage') |
|
| 38 | ); |
|
| 39 | } |
|
| 40 | ||
| 41 | public function testSetSharedMaxAgeNoReplace() |
|
| 42 | { |
|
| @@ 41-53 (lines=13) @@ | ||
| 38 | ); |
|
| 39 | } |
|
| 40 | ||
| 41 | public function testSetSharedMaxAgeNoReplace() |
|
| 42 | { |
|
| 43 | $configurator = new ResponseCacheConfigurator(); |
|
| 44 | ||
| 45 | $response = new Response(); |
|
| 46 | $configurator->setSharedMaxAge($response, 30); |
|
| 47 | $configurator->setSharedMaxAge($response, 60); |
|
| 48 | ||
| 49 | self::assertEquals( |
|
| 50 | 30, |
|
| 51 | $response->headers->getCacheControlDirective('s-maxage') |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testSetSharedMaxAgeReplace() |
|
| 56 | { |
|
| @@ 55-67 (lines=13) @@ | ||
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testSetSharedMaxAgeReplace() |
|
| 56 | { |
|
| 57 | $configurator = new ResponseCacheConfigurator(); |
|
| 58 | ||
| 59 | $response = new Response(); |
|
| 60 | $configurator->setSharedMaxAge($response, 30); |
|
| 61 | $configurator->setSharedMaxAge($response, 60, true); |
|
| 62 | ||
| 63 | self::assertEquals( |
|
| 64 | 60, |
|
| 65 | $response->headers->getCacheControlDirective('s-maxage') |
|
| 66 | ); |
|
| 67 | } |
|
| 68 | ||
| 69 | public function testAddCacheTags() |
|
| 70 | { |
|