Skip to content

Commit 06c146e

Browse files
committed
💚 touch not working in action
Signed-off-by: bnomei <[email protected]>
1 parent ebea513 commit 06c146e

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

composer.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/FingerprintTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,14 @@ public function testProcess()
8686

8787
$root = (new FingerprintFile($this->assetPath))->fileRoot();
8888
$this->assertTrue(F::exists($root));
89-
// this does not work on travis/gh
90-
$this->assertTrue(touch($root, time()-24*60*7));
91-
clearstatcache(); // https://stackoverflow.com/a/17380654
89+
// this does not work on travis/gh ...
90+
// $this->assertTrue(touch($root, time()-24*60*7));
91+
// clearstatcache(); // https://stackoverflow.com/a/17380654
92+
// ... use copy/unlink instead
93+
copy($root, $root.'.bak');
94+
unlink($root);
95+
copy($root.'.bak', $root);
96+
unlink($root.'.bak');
9297
$lookupTouched = $fipr->process($this->assetPath);
9398
$this->assertTrue($lookup['modified'] !== $lookupTouched['modified']);
9499
$this->assertTrue($lookup['hash'] !== $lookupTouched['hash']);

vendor/Expectation.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Pest;
4+
5+
/**
6+
7+
*/
8+
final class Expectation {}

0 commit comments

Comments
 (0)