Use correct default $WP_TESTS_DIR on MacOS#67
Conversation
templates/plugin-bootstrap.mustache
Outdated
|
|
||
| if ( ! $_tests_dir ) { | ||
| $_tests_dir = '/tmp/wordpress-tests-lib'; | ||
| $_tmpdir = getenv( 'TMPDIR' ); |
There was a problem hiding this comment.
For Windows compat could use $_tmpdir = sys_get_temp_dir() instead?
templates/plugin-bootstrap.mustache
Outdated
| if ( ! $_tmpdir ) { | ||
| $_tmpdir = '/tmp'; | ||
| } | ||
| $_tests_dir = preg_replace( '#/$#', '', $_tmpdir ) . '/wordpress-tests-lib'; |
There was a problem hiding this comment.
Similarly rtrim( $_tmpdir, '/\\' ) instead of the preg_replace()?
|
Actually noticed that |
|
@gitlost Thanks 😊 I have a basic question. What is
Oh! |
It's just a backslash, the Windows directory separator. In single-quoted PHP strings, you have to escape a backslash (and a single quote) with a backslash (language.types.string.syntax.single).
So this code could be simplified to |
!! 👍 |
|
@gitlost Thanks! I did. 😊 |
get correct WP_TESTS_DIR on mcOS by default
The default value of
$TMPDIRis not/tmpon macOS.Related: #61