Skip to content

Commit 04119db

Browse files
committed
Remove version-specific branches in tests
1 parent b120c8b commit 04119db

File tree

1 file changed

+0
-126
lines changed

1 file changed

+0
-126
lines changed

features/install-wp-tests.feature

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Feature: Scaffold install-wp-tests.sh tests
1414
"""
1515
And the return code should be 1
1616

17-
@require-php-5.6 @less-than-php-8.0
1817
Scenario: Install latest version of WordPress
1918
Given a WP install
2019
And a affirmative-response file:
@@ -127,131 +126,6 @@ Feature: Scaffold install-wp-tests.sh tests
127126
Leaving the existing database (wp_cli_test_scaffold) in place
128127
"""
129128
130-
@require-php-8.0
131-
Scenario: Install latest version of WordPress on PHP 8.0+
132-
Given a WP install
133-
And a affirmative-response file:
134-
"""
135-
Y
136-
"""
137-
And a negative-response file:
138-
"""
139-
No
140-
"""
141-
And a get-phpunit-phar-url.php file:
142-
"""
143-
<?php
144-
$version = 4;
145-
if(PHP_VERSION_ID >= 50600) {
146-
$version = 5;
147-
}
148-
if(PHP_VERSION_ID >= 70000) {
149-
$version = 6;
150-
}
151-
if(PHP_VERSION_ID >= 70100) {
152-
$version = 7;
153-
}
154-
if(PHP_VERSION_ID >= 80000) {
155-
$version = 9;
156-
}
157-
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
158-
"""
159-
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
160-
And save STDOUT as {PHPUNIT_PHAR_URL}
161-
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
162-
And I run `chmod +x phpunit`
163-
And I run `wp plugin path`
164-
And save STDOUT as {PLUGIN_DIR}
165-
And I run `wp scaffold plugin hello-world`
166-
# This throws a warning for the password provided via command line.
167-
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"`
168-
169-
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`
170-
Then the return code should be 0
171-
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
172-
"""
173-
data
174-
"""
175-
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
176-
"""
177-
includes
178-
"""
179-
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
180-
"""
181-
wp-tests-config.php
182-
"""
183-
And the {RUN_DIR}/wordpress directory should contain:
184-
"""
185-
index.php
186-
license.txt
187-
readme.html
188-
wp-activate.php
189-
wp-admin
190-
wp-blog-header.php
191-
wp-comments-post.php
192-
wp-config-sample.php
193-
wp-content
194-
wp-cron.php
195-
wp-includes
196-
wp-links-opml.php
197-
wp-load.php
198-
wp-login.php
199-
wp-mail.php
200-
wp-settings.php
201-
wp-signup.php
202-
wp-trackback.php
203-
xmlrpc.php
204-
"""
205-
And the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
206-
And STDERR should contain:
207-
"""
208-
install_test_suite
209-
"""
210-
211-
# This throws a warning for the password provided via command line.
212-
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
213-
And STDOUT should contain:
214-
"""
215-
wp_cli_test_scaffold
216-
"""
217-
218-
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
219-
Then the return code should be 1
220-
And STDOUT should contain:
221-
"""
222-
Looks like you're using PHPUnit 9.5.
223-
"""
224-
And STDOUT should contain:
225-
"""
226-
WordPress requires at least PHPUnit 5.
227-
"""
228-
And STDOUT should contain:
229-
"""
230-
and is currently only compatible with PHPUnit up to 7.x.
231-
"""
232-
233-
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`
234-
Then the return code should be 0
235-
And STDERR should contain:
236-
"""
237-
Reinstalling
238-
"""
239-
And STDOUT should contain:
240-
"""
241-
Recreated the database (wp_cli_test_scaffold)
242-
"""
243-
244-
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`
245-
Then the return code should be 0
246-
And STDERR should contain:
247-
"""
248-
Reinstalling
249-
"""
250-
And STDOUT should contain:
251-
"""
252-
Leaving the existing database (wp_cli_test_scaffold) in place
253-
"""
254-
255129
Scenario: Install WordPress from trunk
256130
Given a WP install
257131
And a get-phpunit-phar-url.php file:

0 commit comments

Comments
 (0)