File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,27 @@ echo "\n";
3434$ actualPath = \Patchwork \CodeManipulation \getCachedPath ($ file );
3535
3636echo $ actualPath === $ expectedPath ? 'PASS ' : 'FAIL ' ;
37+ echo "\n" ;
38+
39+ // Third pass - index.csv file exists, different file being passed.
40+ // This test would hit a PHP 8.4 deprecation without the fix from PR #170.
41+
42+ // Reset the state to ensure we hit the code which would cause the deprecation
43+ // notice without the fix from #170.
44+ Patchwork \CodeManipulation \State::$ cacheIndexFile = null ;
45+ Patchwork \Config \State::$ cachePath = $ cachePath ;
46+
47+ $ file = 'another-file.php ' ;
48+ $ hash = md5 ($ file );
49+
50+ $ expectedPath = $ cachePath . '/ ' . $ hash . '.php ' ;
51+
52+ $ actualPath = \Patchwork \CodeManipulation \getCachedPath ($ file );
53+
54+ echo $ actualPath === $ expectedPath ? 'PASS ' : 'FAIL ' ;
55+ echo "\n" ;
3756?>
57+ ===DONE===
3858
3959--CLEAN--
4060<?php
@@ -46,3 +66,5 @@ rmdir(__DIR__ . '/cache');
4666--EXPECT--
4767PASS
4868PASS
69+ PASS
70+ ===DONE===
You can’t perform that action at this time.
0 commit comments