Add test for checking existence of database

Add test for checking whether the database already exists, and how to handle it
This commit is contained in:
Ted Stresen-Reuter 2020-02-05 16:53:51 +00:00
parent 39ffec66d0
commit 0f05f51f26

View file

@ -17,6 +17,10 @@ Feature: Scaffold install-wp-tests.sh tests
@require-php-5.6
Scenario: Install latest version of WordPress
Given a WP install
And a affirmative-response file:
"""
Y
"""
And I run `wp plugin path`
And save STDOUT as {PLUGIN_DIR}
And I run `wp scaffold plugin hello-world`
@ -76,6 +80,13 @@ Feature: Scaffold install-wp-tests.sh tests
When I run `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
Then the return code should be 0

When I try `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib WP_CORE_DIR=/tmp/behat-wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold wp_cli_test password1 localhost latest < affirmative-response`
Then the return code should be 0
And STDOUT should contain:
"""
Recreated the database
"""

@require-php-5.6
Scenario: Install WordPress from trunk
Given a WP install