I tried to run an example from here: http://docs.phalconphp.com/en/latest/reference/unit-testing.html
I created composer file:
{
"require": {
"phalcon/incubator": "dev-master"
}
}
After composer installation I've tried to run phpunit and got an error:
PHP Fatal error: Class 'Codeception\TestCase\Test' not found in /www/tests/vendor/phalcon/incubator/codeception/unit/Phalcon/Validation/Validator/Db/UniquenessTest.php on line 9
I added new dependency:
composer require "codeception/codeception:*"
It added many dependencies.
After that I got another error:
PHP Warning: require_once(tests/data/app/data.php): failed to open stream: No such file or directory in www/tests/vendor/codeception/codeception/tests/unit/Codeception/Module/FacebookTest.php on line 3
I changed
require_once(tests/data/app/data.php)
to
require_once(__DIR__ . '/../../../../tests/data/app/data.php')
in follow follow files:
www/tests/vendor/codeception/codeception/tests/unit/Codeception/Module/WebDriverTest.php
www/tests/vendor/codeception/codeception/tests/unit/Codeception/Module/WFacebookTest.php
www/tests/vendor/codeception/codeception/tests/unit/Codeception/Module/PhpBrowserTest.php
Ok. Phpunit running...I've got next error:
PHP Fatal error: Class 'WebDriverTestCase' not found in `www/tests/vendor/facebook/webdriver/tests/functional/BaseTest.php on line 16`
Ok.. I tried to include:
require_once __DIR__ . '/WebDriverTestCase.php';
to
www/tests/vendor/facebook/webdriver/tests/functional/BaseTest.php
Now I have following error which I cannot fix:
PHP Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Class "PHPUnit_Extensions_RepeatedTest" does not extend PHPUnit_Framework_TestCase.' in www/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php:195
Stack trace:
#0 /www/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php(324): PHPUnit_Framework_TestSuite->__construct(Object(ReflectionClass))
#1 /www/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php(409): PHPUnit_Framework_TestSuite->addTestSuite(Object(ReflectionClass))
#2 /www/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php(435): PHPUnit_Framework_TestSuite->addTestFile('/Users/anthony/...')
#3 phar:///usr/local/zend/bin/phpunit/phpunit/Util/Configuration.php(911): PHPUnit_Framework_TestSuite->addTestFiles(Array)
#4 phar:///usr/local/zend/bin/phpunit/phpunit/Util/Configuration.php(825): PHPUnit_Util_Configura in /www/tests/UnitTestCase.php on line 61
I thought composer should make your life easer by it seems doesn't. Is it ok I have to change some code in vendor libraries?!... where I'm doing wrong? I just need to use phpunit in phalcon...