wp-hammer icon indicating copy to clipboard operation
wp-hammer copied to clipboard

Run unit tests from wp-hammer folder

Open iandunn opened this issue 7 years ago • 1 comments

I may just be doing something wrong, but it seems like I have to run the unit tests from the ~/.wp-cli/packages folder, since _manually_load_plugin() assumes that's the current folder. If I run it from the wp-hammer folder, it fails:

> phpunit
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml

Warning: require_once(/Users/iandunn/.wp-cli/packages/vendor/ivankruchkoff/wp-hammer/vendor/autoload.php): failed to open stream: No such file or directory in /Users/iandunn/.wp-cli/packages/vendor/ivankruchkoff/wp-hammer/tests/bootstrap.php on line 11

Running it from the packages folder works, but requires manually passing the config file (phpunit -c vendor/ivankruchkoff/wp-hammer/phpunit.xml), instead of being able to just run phpunit.

It seems like the latter would be more convenient; is there a reason it's setup to use the former instead?

iandunn avatar Sep 09 '18 00:09 iandunn

Oh, is this because of the difference in installing via wp package vs git clone ... composer install?

If that's the case, then it'd probably be pretty easy to modify _manually_load_plugin() to support both approaches.

iandunn avatar Sep 09 '18 15:09 iandunn