N
N
NetyNicka2015-06-19 16:54:20
PHP
NetyNicka, 2015-06-19 16:54:20

Phalcon unit test example not working, where is the error?

Good day comrades!
In the course of getting to know Phalcon, I came across a problem with unit testing, an example of which is in the framework documentation .
With a normal copy-paste, an error appears:

PHP Fatal error: Class 'UnitTestCase' not found in /home/Dev/web/testproject.local/public_html/tests/testsTestUnitTest.php on line 5

Addendum (googled before posting the question)
$loader->registerNamespaces(array(
    'Phalcon' => '/var/tmp/incubator/Library/Phalcon/'
));

in the file TestHelper.php did not bring any results.
Also confuses the moment with the line:
// required for phalcon/incubator
include __DIR__ . "/../vendor/autoload.php";

Since there are no autoload.php files in the /incubator/ folder. The example also indicates a link to ../vendor/autoload.php, but again it is not clear what should be in this folder and in this file. Help out comrades! How to run this fascinating unit test?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Khomenko, 2015-06-19
@NetyNicka

Not familiar with Falcon (!!!), but based on

// required for phalcon/incubator
include __DIR__ . "/../vendor/autoload.php";

and
I conclude that you do not have Composer packages installed that are needed for testing. This thing /vendor/autoload.php is generated by the composer.

L
LittleFatNinja, 2015-06-19
@LittleFatNinja

added to php.ini?
extension=phalcon.so

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question