You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Yii framework has a file cache driver that checks a file-based cache by calling @filemtime($cacheFile). That returns the modification date of the file, if it exists, or emits a warning (and returns false) if the cache file doesn't exist. The warning it emits is not suppressed by the @ operator so my tests are all littered with ! warning annotations. E.g.,
$./vendor/bin/pest tests/ActingAsTest.php -vvv --display-warnings
WARN Tests\ActingAsTest
! it logs in users by factory → filemtime(): stat failed for /Users/markhuot/Sites/craft-pest-core/storage/runtime/cache/8e/CraftCMS8e0694a5966c89b99615fb42a4a74296.bin 0.28s
✓ it logs in users by email address 0.01s
✓ it logs in user objects 0.01s
! it logs in admins via shorthand → filemtime(): stat failed for /Users/markhuot/Sites/craft-pest-core/storage/runtime/cache/ba/CraftCMSbasePath.bin 0.21s
✓ it throws on missing users
✓ it should not be logged in on subsequent tests
! it acts as a user on get requests → filemtime(): stat failed for /Users/markhuot/Sites/craft-pest-core/storage/runtime/cache/62/CraftCMS62f10a620b432ee970868362b84379c4.bin 0.02s
! it creates admin users → filemtime(): stat failed for /Users/markhuot/Sites/craft-pest-core/storage/runtime/cache/62/CraftCMS62f10a620b432ee970868362b84379c4.bin 0.03s
! it resets globals during twig parsing → filemtime(): stat failed for /Users/markhuot/Sites/craft-pest-core/storage/runtime/cache/90/CraftCMS90d3d81bc326013c006a844c726840fb.bin 0.02s
I've asked Yii about prepending the filemtime() check with a file_exists() check but there is atomicity concerns if the file exists during the file_exists() check but is deleted before the filemtime() check runs. So the request now bumps back over to Pest: should warnings be suppressed if errors are suppressed via the @ operator?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The Yii framework has a file cache driver that checks a file-based cache by calling
@filemtime($cacheFile)
. That returns the modification date of the file, if it exists, or emits a warning (and returns false) if the cache file doesn't exist. The warning it emits is not suppressed by the@
operator so my tests are all littered with!
warning annotations. E.g.,I've asked Yii about prepending the
filemtime()
check with afile_exists()
check but there is atomicity concerns if the file exists during thefile_exists()
check but is deleted before thefilemtime()
check runs. So the request now bumps back over to Pest: should warnings be suppressed if errors are suppressed via the@
operator?Beta Was this translation helpful? Give feedback.
All reactions