Skip to content

Commit ae766be

Browse files
Add test for Filesystem lastModified method (#55389)
1 parent 25b1d76 commit ae766be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/Filesystem/FilesystemTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,19 @@ public function testHash()
648648
$this->assertSame('76d3bc41c9f588f7fcd0d5bf4718f8f84b1c41b20882703100b9eb9413807c01', $filesystem->hash(self::$tempDir.'/foo.txt', 'sha3-256'));
649649
}
650650

651+
public function testLastModifiedReturnsTimestamp()
652+
{
653+
$path = self::$tempDir.'/timestamp.txt';
654+
file_put_contents($path, 'test content');
655+
656+
$filesystem = new Filesystem;
657+
$timestamp = $filesystem->lastModified($path);
658+
659+
$this->assertIsInt($timestamp);
660+
$this->assertGreaterThan(0, $timestamp);
661+
$this->assertEquals(filemtime($path), $timestamp);
662+
}
663+
651664
/**
652665
* @param string $file
653666
* @return int

0 commit comments

Comments
 (0)