lucatume / wp-browser

The easy and reliable way to test WordPress with Codeception. 10 years of proven success.
https://wpbrowser.wptestkit.dev/
MIT License
603 stars 86 forks source link

missing try, catch for filesystem->unlink #242

Closed halmos closed 5 years ago

halmos commented 5 years ago

In Symlink Extension, the filesystem->unlink should be wrapped in a try { } catch () {}.

In my use case, there is a conflict with the Local by Flywheel volumes extension in which i have my theme dev folder remapped. When the symlink extension tries to unlink the directory, a \PHPUnit\Framework\Exception is thrown because the directory cannot be removed. The code below checks for falsy result, but fails to catch exception. For this reason, the test suite does not complete.

https://github.com/lucatume/wp-browser/blob/e5f2123fc9e69e49fd416e1f627f187fe0109536/src/tad/WPBrowser/Extension/Symlinker.php#L108-L112

lucatume commented 5 years ago

Thanks for the report, I will fix this in the next version.