3

I've been following the instructions in this article to try to set up some testing.

I got as far as this instruction bash bin/install-wp-tests.sh wordpress_test root 'mypass' localhost latest before I hit some problems.

I have git bash installed so the command ran, but I got this error when I runphpunit:

Fatal error: require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.;C:\php\pear') in C:\Program Files (x86)\Ampps\www\dev\robinandrews-wp\wp-content\plugins\plugin-testing\tests\bootstrap.php on line 14

Not sure that include path looks right? If that's the prop how can I change it, and what to?

Any help much appreciated.

The output from the above command is:

+ install_wp
+ '[' -d /tmp/wordpress/ ']'
+ return
+ install_test_suite
++ uname -s
+ [[ MSYS_NT-10.0 == \D\a\r\w\i\n ]]
+ local ioption=-i
+ '[' '!' -d /tmp/wordpress-tests-lib ']'
+ '[' '!' -f wp-tests-config.php ']'
+ download https://develop.svn.wordpress.org/tags/4.7.3/wp-tests-config-sample.php /tmp/wordpress-tests-lib/wp-tests-config.php
++ which curl
+ '[' /mingw64/bin/curl ']'
+ curl -s https://develop.svn.wordpress.org/tags/4.7.3/wp-tests-config-sample.php
++ echo /tmp/wordpress/
++ sed 's:/\+$::'
+ WP_CORE_DIR=/tmp/wordpress
+ sed -i 's:dirname( __FILE__ ) . '\''/src/'\'':'\''/tmp/wordpress/'\'':' /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i s/youremptytestdbnamehere/wordpress_test/ /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i s/yourusernamehere/root/ /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i s/yourpasswordhere/mysql/ /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i 's|localhost|localhost|' /tmp/wordpress-tests-lib/wp-tests-config.php
+ install_db
+ '[' false = true ']'
+ PARTS=(${DB_HOST//\:/ })
+ local PARTS
+ local DB_HOSTNAME=localhost
+ local DB_SOCK_OR_PORT=
+ local EXTRA=
+ '[' -z localhost ']'
++ echo
++ grep -e '^[0-9]\{1,\}$'
+ '[' ']'
+ '[' -z ']'
+ '[' -z localhost ']'
+ EXTRA=' --host=localhost --protocol=tcp'
+ mysqladmin create wordpress_test --user=root --password=mypass --host=localhost --protocol=tcp
1
  • That command is assuming *nix, I think, so the fact that you are on Windows is probably what fouled things up. It was attempting to add set up the WordPress test suite in /tmp/wordpress-tests-lib, but apparently that didn't happen correctly—or, maybe it did, but you need to modify the include path in robinandrews-wp\wp-content\plugins\plugin-testing\tests\bootstrap.php on line 14, to be Windows compatible (C:\tmp\wordpress-tests-lib?). You might try setting up something with Vagrant instead, like VVV.
    – J.D.
    Commented Mar 28, 2017 at 14:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.