Skip to content

Commit

Permalink
Need to use install-wp-tests.sh before running phpunit.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlost committed Jan 15, 2018
1 parent cd27743 commit 7fcf9b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions features/scaffold-theme-tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ Feature: Scaffold theme unit tests
"""
<?php echo __FILE__ . " loaded.\n";
"""
And I run `MYSQL_PWD=password1 mysql -u wp_cli_test -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
And I try `rm -fr /tmp/behat-wordpress`
And I try `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib WP_CORE_DIR=/tmp/behat-wordpress {THEME_DIR}/p2child/bin/install-wp-tests.sh wp_cli_test_scaffold wp_cli_test password1 localhost latest`
Then the return code should be 0

When I run `cd {THEME_DIR}/p2child; phpunit`
When I run `cd {THEME_DIR}/p2child; WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib phpunit`
Then STDOUT should contain:
"""
p2child/functions.php loaded.
Expand All @@ -93,7 +98,7 @@ Feature: Scaffold theme unit tests
OK (1 test, 1 assertion)
"""

When I run `cd {THEME_DIR}/p2child; WP_MULTISITE=1 phpunit`
When I run `cd {THEME_DIR}/p2child; WP_MULTISITE=1 WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib phpunit`
Then STDOUT should contain:
"""
p2child/functions.php loaded.
Expand Down

0 comments on commit 7fcf9b7

Please sign in to comment.