1

When I run phpunit tests in Laravel using /vendor/bin/phpunit the tests are executed and the results are generated. I am also able to do tests on a single file with /vendor/bin/phpunit </tests/<filename>

However, when I execute the following command it fails:

./vendor/bin/phpunit ./

Fatal error: Class 'Codeception\Module\OrderHelper' not found in /vendor/codeception/codeception/tests/data/claypit/tests/order/ParsedLoadedTest.php on line 2

But I could see that the OrderHelper file still exist.

<project-folder>/vendor/codeception/codeception/tests/data/claypit/tests/_support/OrderHelper.php

Can anyone help me in this?

2 Answers 2

2

The directory passed to phpunit should be the directory where the tests are. So just change it to ./vendor/bin/phpunit ./tests and it should work fine.

Sign up to request clarification or add additional context in comments.

Comments

0

No need to point the directory.. try to do this. it may help you.
Bulk File

vendor/bin/phpunit

Single File

vendor/bin/phpunit <fileName>

1 Comment

Yes, that was working for me. But I am trying to find the issue with the other command.. My client is also getting the same error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.