With pear installation dependencies [ Now pear packages are not updated better, install with composer )
sudo pear channel-discover pear.phpunit.de sudo pear install phpunit/PHPUnit_Story sudo pear install phpunit/PHP_Selenium
It is better if you install phpunit with a composer, these errors will not appear
step 1: Create a composer.json file in the root of your project:
{ "require-dev": { "phpunit/phpunit": "4.6.*", "phpunit/phpunit-selenium": ">=1.4", "phpunit/dbunit": ">=1.3", "phpunit/phpunit-story": "*", "phpunit/php-invoker": "*" }, "autoload": { "psr-0": {"": "src"} }, "config": { "bin-dir": "bin/" } }
step 2: Install the composer in your project using:
curl -sS https://getcomposer.org/installer | php
Ensure composer execution:
chmod +x composer.phar
Let the composer establish the dependencies:
./composer.phar install
Make sure you have the version for the specific phpunit project installed:
bin/phpunit
the above is a soft link
ls -la bin/phpunit bin/phpunit -> ../vendor/phpunit/phpunit/phpunit
Afterword you can make softlink from "phpunit" from the vendor directory to the directory used by php. This will clear all warnings related to
PHP Warning: include(classes/PHPUnit_Extensions_Story_TestCase.php) PHP Warning: include(): Failed opening 'classes/PHPUnit_Extensions_Story_TestCase.php' PHP Warning: include(classes/Composer\Autoload\ClassLoader.php)
source share