setConfig(['duration' => 10]); $result = $engine->getDuration($ttl); $this->assertSame($result, $expected); } /** * Test duration value should be \DateInterval, int or null. */ public function testDurationException(): void { $engine = new TestAppCacheEngine(); $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('TTL values must be one of null, int, \DateInterval'); $engine->getDuration('ttl'); } }