Error when setting up phpunit tests with wp-cli scaffold
I am trying to figure out the setup for unit tests for wordpress plugins. I am using Ubuntu. So far I have:
- Local WordPress Installation
- WP-CLI up and running
- Installed phpunit
- used wp scaffold command to generate unit test files
When I now try and run the phpunit command I get the following error:
PHP Warning: require_once(/tmp/wordpress//wp-includes/class- phpmailer.php): failed to open stream: No such file or directory in /tmp/wordpress-tests-lib/includes/mock-mailer.php on line 2
PHP Fatal error: require_once(): Failed opening required '/tmp/wordpress//wp-includes/class-phpmailer.php' (include_path='.:/usr/share/php:/usr/share/pear') in /tmp/wordpress-tests-lib/includes/mock-mailer.php on line 2
This is my wp --info:
PHP binary: /usr/bin/php5
PHP version: 5.6.11-1ubuntu3.4
php.ini used: /etc/php5/cli/php.ini
WP-CLI root dir: phar://wp-cli.phar
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 1.0.0
I am trying to follow this tutorial:
https://pippinsplugins.com/unit-tests-wordpress-plugins-setting-up-testing-suite/
Thank you for any help!!!
Topic unit-tests wp-cli plugins Wordpress
Category Web