Skip to content

Commit

Permalink
Remove version-specific branches in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Jan 25, 2022
1 parent b120c8b commit 04119db
Showing 1 changed file with 0 additions and 126 deletions.
126 changes: 0 additions & 126 deletions features/install-wp-tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Feature: Scaffold install-wp-tests.sh tests
"""
And the return code should be 1

@require-php-5.6 @less-than-php-8.0
Scenario: Install latest version of WordPress
Given a WP install
And a affirmative-response file:
Expand Down Expand Up @@ -127,131 +126,6 @@ Feature: Scaffold install-wp-tests.sh tests
Leaving the existing database (wp_cli_test_scaffold) in place
"""
@require-php-8.0
Scenario: Install latest version of WordPress on PHP 8.0+
Given a WP install
And a affirmative-response file:
"""
Y
"""
And a negative-response file:
"""
No
"""
And a get-phpunit-phar-url.php file:
"""
<?php
$version = 4;
if(PHP_VERSION_ID >= 50600) {
$version = 5;
}
if(PHP_VERSION_ID >= 70000) {
$version = 6;
}
if(PHP_VERSION_ID >= 70100) {
$version = 7;
}
if(PHP_VERSION_ID >= 80000) {
$version = 9;
}
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
"""
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
And save STDOUT as {PHPUNIT_PHAR_URL}
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
And I run `chmod +x phpunit`
And I run `wp plugin path`
And save STDOUT as {PLUGIN_DIR}
And I run `wp scaffold plugin hello-world`
# This throws a warning for the password provided via command line.
And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest`
Then the return code should be 0
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
"""
data
"""
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
"""
includes
"""
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
"""
wp-tests-config.php
"""
And the {RUN_DIR}/wordpress directory should contain:
"""
index.php
license.txt
readme.html
wp-activate.php
wp-admin
wp-blog-header.php
wp-comments-post.php
wp-config-sample.php
wp-content
wp-cron.php
wp-includes
wp-links-opml.php
wp-load.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
xmlrpc.php
"""
And the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
And STDERR should contain:
"""
install_test_suite
"""
# This throws a warning for the password provided via command line.
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
And STDOUT should contain:
"""
wp_cli_test_scaffold
"""
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
Then the return code should be 1
And STDOUT should contain:
"""
Looks like you're using PHPUnit 9.5.
"""
And STDOUT should contain:
"""
WordPress requires at least PHPUnit 5.
"""
And STDOUT should contain:
"""
and is currently only compatible with PHPUnit up to 7.x.
"""
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest < affirmative-response`
Then the return code should be 0
And STDERR should contain:
"""
Reinstalling
"""
And STDOUT should contain:
"""
Recreated the database (wp_cli_test_scaffold)
"""
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest < negative-response`
Then the return code should be 0
And STDERR should contain:
"""
Reinstalling
"""
And STDOUT should contain:
"""
Leaving the existing database (wp_cli_test_scaffold) in place
"""
Scenario: Install WordPress from trunk
Given a WP install
And a get-phpunit-phar-url.php file:
Expand Down

0 comments on commit 04119db

Please sign in to comment.