Closed mrsdizzie closed 11 months ago
Thanks for the report, @mrsdizzie !
I think the fix can be as simple as a conditional based on PHP_OS
: https://github.com/wp-cli/wp-cli-tests/pull/183
We have some of these conditionals elsewhere (see use of is_windows()
), so I think it's fine to use another in this case.
This function is used in a lot of the tests:
https://github.com/wp-cli/wp-cli-tests/blob/c2d228bbfe6eecc0cab3cfe71ea0d04c4ae1e095/src/Context/FeatureContext.php#L826-L828
On MacOS I have tests that fail with errors like:
etc...
I believe this is caused by trying to copy symlinks around, as discussed here: https://unix.stackexchange.com/questions/500379/cp-works-differently-on-a-mac
I thought I could get around this by installing GNU cp from homebrew, but it doesn't work because even though I have it in my
PATH
, I think wp-cli is setting an empty ENV here:https://github.com/wp-cli/wp-cli/blob/main/php/WP_CLI/Process.php#L52-L60
I'm not exactly sure what the solution is, but just want to document it here. Options seem to be:
Process::create
call and having users install GNU cpcp -a instead