We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Class 'UnitTestCase' not found

Hello,

I'm running phpunit with instructions from https://docs.phalcon.io/en/latest/reference/unit-testing.html#sample-unit-test

and I'm getting Class 'UnitTestCase' not found error like in this question http://stackoverflow.com/questions/18859383/phalcon-unittesting

This in TestHelper.php doesn't help:

$loader->registerNamespaces([
    'Phalcon' => '../vendor/phalcon/incubator/Library/Phalcon/'
]);

It's like after composer install incubator lib is not detected but other classes from Phalcon works ok



986
Accepted
answer

Problem solved. Remember to run phpunit in tests folder. phpunit tests/ command doesn't work.