wordpress - WP_UnitTestCase - how to configure the include_path correctly with phpunit PHAR -


i'm trying write php unit test wordpress plugin , have been following writing-wordpress-plugin-unit-tests tutorial. i've cloned 'core.trac.wordpress.org/browser/tests/trunk/includes' locally

i have installed phpunit via phar mechanism described here : https://phpunit.de/manual/current/en/installation.html#installation.requirements. have composer.json configuration

[14:11:04@~]$ phpunit --version phpunit 4.7.3 sebastian bergmann , contributors. 

in /etc/php.ini file have

include_path="." 

when run phpunit error

[14:18:07@bhaawp]$ phpunit  php fatal error:  require_once(): failed opening required 'phpunit/autoload.php' (include_path='.') in /users/pauloconnell/projects/bhaawp/wp-phpunit/bootstrap.php on line 7 

the bootstrap.php file has include

<?php /**  * installs wordpress running tests , loads wordpress , test libraries  */ require_once 'phpunit/autoload.php'; 

i think need add phpunit folder path, having mental block should set to?

you need clone https://core.trac.wordpress.org/browser/trunk/tests/phpunit/includes/ instead. 1 cloning old , no longer updated.

you see that line no longer there in new bootstrap.php.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -