8000 minor #38945 [Finder] Force set access time in test (Nyholm) · symfony/symfony@5c3781a · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c3781a

Browse files
committed
minor #38945 [Finder] Force set access time in test (Nyholm)
This PR was merged into the 4.4 branch. Discussion ---------- [Finder] Force set access time in test | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no, it only updates the tests | New feature? | no | Deprecations? | no | Tickets | Fix #38942 | License | MIT | Doc PR | OSX don't really update atime (access time). They claim it is because performance reasons. So this PR will update the test to make PHP force access time on a file. The different runs of `testAccept` depends on each other because each test modifies the filesystem a bit. That is why I added the extra `sleep(1)`. Commits ------- c5ec51a [Finder] Force set access time in test
2 parents 20306a2 + c5ec51a commit 5c3781a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ public function testAccept($mode, $expected)
3535
case SortableIterator::SORT_BY_ACCESSED_TIME:
3636
touch(self::toAbsolute('.git'));
3737
sleep(1);
38-
file_get_contents(self::toAbsolute('.bar'));
38+
touch(self::toAbsolute('.bar'), time());
3939
break;
4040
case SortableIterator::SORT_BY_CHANGED_TIME:
41+
sleep(1);
4142
file_put_contents(self::toAbsolute('test.php'), 'foo');
4243
sleep(1);
4344
file_put_contents(self::toAbsolute('test.py'), 'foo');

0 commit comments

Comments
 (0)
0