llundin llundin - 5 months ago 72
PHP Question

Phalcon UnitTesting

I am running the example from the documentation: http://docs.phalconphp.com/en/latest/reference/unit-testing.html#sample-unit-test

I want to create an abstract unit test from Phalcon\Test\UnitTestCase as in the documentation. However when I run my test I become:

PHP Fatal error: Class 'Phalcon\Test\UnitTestCase' not found


I have followed the exact documentation steps. Did anyone have the same problem and solved it?

Answer

This class is part of the incubator: https://github.com/phalcon/incubator

$loader = new Phalcon\Loader();

$loader->registerNamespaces(array(
    'Phalcon' => '/path/to/incubator/Library/Phalcon/'
));

$loader->register();
Comments