WordPoints / wordpoints

Points plugin for WordPress
GNU General Public License v2.0
20 stars 15 forks source link

Fatal error running PHPUnit tests for modules not using WPPPB #572

Closed JDGrimes closed 7 years ago

JDGrimes commented 7 years ago
PHP Fatal error:  Class 'WPPPB_Loader' not found in /Users/johngrimes/git/wordpoints/tests/phpunit/classes/bootstrap/loader.php on line 15
PHP Stack trace:
PHP   1. {main}() /Users/johngrimes/.composer/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /Users/johngrimes/.composer/vendor/phpunit/phpunit/phpunit:47
PHP   3. PHPUnit_TextUI_Command->run() /Users/johngrimes/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:100
PHP   4. PHPUnit_TextUI_Command->handleArguments() /Users/johngrimes/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:111
PHP   5. PHPUnit_TextUI_Command->handleBootstrap() /Users/johngrimes/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:598
PHP   6. PHPUnit_Util_Fileloader::checkAndLoad() /Users/johngrimes/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:779
PHP   7. PHPUnit_Util_Fileloader::load() /Users/johngrimes/.composer/vendor/phpunit/phpunit/src/Util/Fileloader.php:38
PHP   8. include_once() /Users/johngrimes/.composer/vendor/phpunit/phpunit/src/Util/Fileloader.php:56
PHP   9. require() /Users/johngrimes/git/_wordpoints-modules/points-logs-regenerator/dev-lib/phpunit/module-bootstrap.php:152
PHP  10. spl_autoload_call() /Users/johngrimes/git/_wordpoints-modules/points-logs-regenerator/dev-lib/phpunit/module-bootstrap.php:107
PHP  11. WordPoints_Dev_Lib_PHPUnit_Class_Autoloader::load_class() /Users/johngrimes/git/_wordpoints-modules/points-logs-regenerator/dev-lib/phpunit/module-bootstrap.php:107
PHP  12. require_once() /Users/johngrimes/git/_wordpoints-modules/points-logs-regenerator/dev-lib/phpunit/classes/class/autoloader.php:120
JDGrimes commented 7 years ago

We also get this if they don't use an older version of the dev-lib:

PHP Warning:  require_once(/tmp/wordpoints/tests/phpunit/../../dev-lib/phpunit/classes/class/autoloader.php): failed to open stream: No such file or directory in /tmp/wordpoints/tests/phpunit/includes/bootstrap.php on line 54
PHP Stack trace:
PHP   1. {main}() /home/travis/.phpenv/versions/5.3.29/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /home/travis/.phpenv/versions/5.3.29/bin/phpunit:722
PHP   3. PHPUnit_TextUI_Command->run() phar:///home/travis/.phpenv/versions/5.3.29/bin/phpunit/phpunit/TextUI/Command.php:104
PHP   4. PHPUnit_TextUI_Command->handleArguments() phar:///home/travis/.phpenv/versions/5.3.29/bin/phpunit/phpunit/TextUI/Command.php:114
PHP   5. PHPUnit_TextUI_Command->handleBootstrap() phar:///home/travis/.phpenv/versions/5.3.29/bin/phpunit/phpunit/TextUI/Command.php:622
PHP   6. PHPUnit_Util_Fileloader::checkAndLoad() phar:///home/travis/.phpenv/versions/5.3.29/bin/phpunit/phpunit/TextUI/Command.php:792
PHP   7. PHPUnit_Util_Fileloader::load() phar:///home/travis/.phpenv/versions/5.3.29/bin/phpunit/phpunit/Util/Fileloader.php:42
PHP   8. include_once() phar:///home/travis/.phpenv/versions/5.3.29/bin/phpunit/phpunit/Util/Fileloader.php:58
PHP   9. require() /home/travis/build/WordPoints/points-logs-regenerator/dev-lib/phpunit/module-bootstrap.php:101
JDGrimes commented 7 years ago

That second error apparently only happens with old versions of the dev-lib, it doesn't happen on master, and of course not on develop. So I may ignore that for now.

JDGrimes commented 7 years ago

I've also discovered this:

There was 1 failure:

1) Warning
No tests found in class "WordPoints_Points_UnitTestCase".

It looks like that class isn't abstract as it should be.