#44605 closed defect (bug) (duplicate)
unit tests that create tmp files should use sys_get_temp_dir() instead of hardcoding /tmp/
Reported by: | pbiron | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | |
Focuses: | Cc: |
Description
A few of the existing unit tests contain the equivalent of:
copy( DIR_TESTDATA . '/images/foo.jpg', '/tmp/foo.jpg' );
Folks running the tests on Windows need to create C:\tmp
for those tests to succeed.
Instead, unit tests should use the equivalent of:
copy( DIR_TESTDATA . '/images/foo.jpg', sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'foo.jpg' );
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
44605.diff fixes all existing tests.
There are a few other occurrences of
/tmp
in the existing tests, but to the best of my knowledge those other uses don't actually try to create temp files in `/tmp'.I would appreciate someone testing the patch on a non-Windows box to make sure the affected tests still succeed.