public function testMustRevalidate()
 {
     $value = $this->object->istMustRevalidate();
     $this->assertTrue($value);
     $expected = false;
     $this->object->setMustRevalidate($expected);
     $value = $this->object->istMustRevalidate();
     $this->assertFalse($value);
 }
 public function onFinish(MvcEvent $e)
 {
     /** @var $response Response */
     $response = $e->getResponse();
     if (!$response instanceof Response) {
         return;
     }
     $headers = $response->getHeaders();
     /** @var $lastModified LastModified  */
     $lastModified = $headers->get('Last-Modified');
     if (!$lastModified instanceof LastModified) {
         $lastModified = new LastModified();
         $headers->addHeader($lastModified);
     }
     /** @var $cacheControl CacheControl */
     $cacheControl = $headers->get('Cache-Control');
     if ($cacheControl instanceof CacheControl) {
         // Nope, you send it... i won't modified it.
         return;
     }
     $cacheControl = new CacheControl();
     $headers->addHeader($cacheControl);
     if (null !== ($value = $this->config->getMaxAge())) {
         $cacheControl->addDirective('max-age', $value);
     }
     if (null !== ($value = $this->config->getSMaxAge())) {
         $cacheControl->addDirective('s-maxage', $value);
     }
     if ($this->config->istMustRevalidate()) {
         $cacheControl->addDirective('must-revalidate');
     }
 }