我正试图找出wordpress插件单元测试的设置。我正在使用Ubuntu。到目前为止,我已经:
本地WordPress安装启动并运行WP-CLI安装的phpunit使用WP scaffold命令生成单元测试文件,当我现在尝试运行phpunit命令时,出现以下错误:
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致命错误:require\\u once():无法打开所需的“/tmp/wordpress//wp includes/class phpmailer。/tmp/wordpress-tests-lib/includes/mock-mailer中的php“(include\\u-path=\'。:/usr/share/php:/usr/share/pear”)。php在线2
这是我的wp--信息:
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
我正在努力学习本教程:
https://pippinsplugins.com/unit-tests-wordpress-plugins-setting-up-testing-suite/
谢谢你的帮助!!!