JDGrimes / wpppb

Bootstrap for integration testing WordPress plugins with PHPUnit
MIT License
13 stars 3 forks source link

Catch all errors during install and usage simulation #5

Closed JDGrimes closed 6 years ago

JDGrimes commented 8 years ago

Originally https://github.com/JDGrimes/wp-plugin-uninstall-tester/issues/18.

JDGrimes commented 6 years ago

Any other errors will be output by system(), they just won't result in outright failure.

JDGrimes commented 6 years ago

Note also, that as far as install goes, as of #14 we will get a failure like this in some cases anyway:

$ phpunit
Not running extension install/uninstall tests... To execute these, use -c phpunit.uninstall.xml.dist.
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Error: Plugin activation failed for wordpoints/wordpoints.php:
- The plugin generated unexpected output.
Remote plugin installation failed with exit code 1
JDGrimes commented 6 years ago

I just discovered a situation where unexpected output was being produced, but for some reason we weren't failing. We should check if system() produces any output, and always fail if it does.

JDGrimes commented 6 years ago

It is possible to catch all errors while still having them display. However, this won't include the usual backtrace from xDebug.

JDGrimes commented 6 years ago

I think that we could use xdebug.halt_level to do what we want.