Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.1] PHPUnit can only be run from project root #30205

Closed
jacksontong opened this issue Oct 7, 2019 · 2 comments
Closed

[6.1] PHPUnit can only be run from project root #30205

jacksontong opened this issue Oct 7, 2019 · 2 comments

Comments

@jacksontong
Copy link

  • Laravel Version: 6.1.0
  • PHP Version: 7.3.9
  • Database Driver & Version:

Description:

I have similar issue with #29862, instead the error is

[sftp://vagrant@yogapay.test:22]:/usr/bin/php /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/phpunit --configuration /home/vagrant/code/yoga-pay/phpunit.xml --filter "/(::test_teacher_cannot_create_yoga_class)( .*)?$/" Tests\\Feature\\Api\\YogaClassTest /home/vagrant/code/yoga-pay/tests/Feature/Api/YogaClassTest.php --teamcity
PHP Fatal error:  Uncaught PHPUnit\Runner\Exception: Class 'Tests\\Feature\\Api\\YogaClassTest' could not be found in '/home/vagrant/code/yoga-pay/tests/Feature/Api/YogaClassTest.php'. in /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php:65
Stack trace:

#0 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(141): PHPUnit\Runner\StandardTestSuiteLoader->load('Tests\\\\Feature\\...', '/home/vagrant/c...')
Fatal error: Uncaught PHPUnit\Runner\Exception: Class 'Tests\\Feature\\Api\\YogaClassTest' could not be found in '/home/vagrant/code/yoga-pay/tests/Feature/Api/YogaClassTest.php'. in /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php:65
#1 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(101): PHPUnit\Runner\BaseTestRunner->loadSuiteClass('Tests\\\\Feature\\...', '/home/vagrant/c...')
Stack trace:
#2 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/TextUI/Command.php(177): PHPUnit\Runner\BaseTestRunner->getTest('Tests\\\\Feature\\...', '/home/vagrant/c...', Array)
#0 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(141): PHPUnit\Runner\StandardTestSuiteLoader->load('Tests\\\\Feature\\...', '/home/vagrant/c...')
#3 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/TextUI/Command.php(159): PHPUnit\TextUI\Command->run(Array, true)
#1 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(101): PHPUnit\Runner\BaseTestRunner->loadSuiteClass('Tests\\\\Feature\\...', '/home/vagrant/c...')
#4 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\C in /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php on line 65
#2 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/TextUI/Command.php(177): PHPUnit\Runner\BaseTestRunner->getTest('Tests\\\\Feature\\...', '/home/vagrant/c...', Array)
#3 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/TextUI/Command.php(159): PHPUnit\TextUI\Command->run(Array, true)
#4 /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\C in /home/vagrant/code/yoga-pay/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php on line 65

Process finished with exit code 255

The terminal command is working fine
phpunit --filter test_authenticated_users_can_fetch_teachers

Steps To Reproduce:

Same with #29862

@driesvints
Copy link
Member

The bootstrapping has been removed in the meantime so I doubt that this is broken atm: laravel/laravel#5107

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to report back and I'll gladly help you out and re-open this issue.

Thanks!

@jacksontong
Copy link
Author

for someone comes here with same issue, this is actually phpunit's issue sebastianbergmann/phpunit#3904
After I downgrade to phpunit 8.3.5 it works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants