We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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 https://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



990
Accepted
answer

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