Esempio n. 1
0
 /**
  * Test valid and invalid values as max age.
  *
  * @covers ::setCacheMaxAge
  * @dataProvider providerSetCacheMaxAge
  */
 public function testSetCacheMaxAge($data, $expect_exception)
 {
     $metadata = new CacheableMetadata();
     if ($expect_exception) {
         $this->setExpectedException('\\InvalidArgumentException');
     }
     $metadata->setCacheMaxAge($data);
     $this->assertEquals($data, $metadata->getCacheMaxAge());
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function getCacheMaxAge()
 {
     return $this->cacheabilityMetadata->getCacheMaxAge();
 }