/** * 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()); }
/** * {@inheritdoc} */ public function getCacheMaxAge() { return $this->cacheabilityMetadata->getCacheMaxAge(); }