Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function testIsValid() |
||
18 | { |
||
19 | $cacheItem = new class implements CacheValidatorInterface { |
||
20 | use FileModificationTimeCacheValidatorTrait; |
||
21 | }; |
||
22 | |||
23 | $file = sys_get_temp_dir().'/test_file_graphql_controllers'; |
||
24 | touch($file, strtotime('2019-01-01')); |
||
25 | $cacheItem->addTrackedFile($file); |
||
26 | |||
27 | $this->assertTrue($cacheItem->isValid()); |
||
28 | |||
29 | touch($file, strtotime('2019-01-02')); |
||
30 | clearstatcache($file); |
||
|
|||
31 | $this->assertFalse($cacheItem->isValid()); |
||
32 | unlink($file); |
||
33 | } |
||
35 |