You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/install-wp-tests.feature
+26-25Lines changed: 26 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,28 @@
1
1
Feature: Scaffold install-wp-tests.sh tests
2
2
3
3
Scenario: Help should be displayed
4
-
When I try `/usr/bin/env bash templates/install-wp-tests.sh`
4
+
Given a WP install
5
+
And I run `wp plugin path`
6
+
And save STDOUT as {PLUGIN_DIR}
7
+
And I run `wp scaffold plugin hello-world`
8
+
9
+
When I try `/usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh`
5
10
Then STDOUT should contain:
6
11
"""
7
12
usage:
8
13
"""
9
14
And the return code should be 1
10
15
11
16
Scenario: Install latest version of WordPress
12
-
Given I run `echo "DROP DATABASE IF EXISTS wordpress_behat_test" | mysql -u root`
13
-
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
14
-
And I try `rm -fr /tmp/behat-wordpress`
15
-
And I run `pwd`
16
-
And save STDOUT as {WORK_DIR}
17
-
And a WP install
17
+
Given a WP install
18
18
And I run `wp plugin path`
19
19
And save STDOUT as {PLUGIN_DIR}
20
+
And I run `wp scaffold plugin hello-world`
21
+
And I run `echo "DROP DATABASE IF EXISTS wordpress_behat_test" | mysql -u root`
22
+
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
23
+
And I try `rm -fr /tmp/behat-wordpress`
20
24
21
-
When I run `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib WP_CORE_DIR=/tmp/behat-wordpress /usr/bin/env bash {WORK_DIR}/templates/install-wp-tests.sh wordpress_behat_test root '' localhost latest`
25
+
When I run `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 wordpress_behat_test root '' localhost latest`
22
26
Then the return code should be 0
23
27
And the /tmp/behat-wordpress-tests-lib directory should contain:
Then the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
67
-
68
70
When I run `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
69
71
Then the return code should be 0
70
72
71
73
Scenario: Install WordPress from trunk
72
-
Given I run `echo "DROP DATABASE IF EXISTS wordpress_behat_test" | mysql -u root`
73
-
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
74
-
And I try `rm -fr /tmp/behat-wordpress`
75
-
And I run `pwd`
76
-
And save STDOUT as {WORK_DIR}
77
-
And a WP install
74
+
Given a WP install
78
75
And I run `wp plugin path`
79
76
And save STDOUT as {PLUGIN_DIR}
77
+
And I run `wp scaffold plugin hello-world`
78
+
And I run `echo "DROP DATABASE IF EXISTS wordpress_behat_test" | mysql -u root`
79
+
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
80
+
And I try `rm -fr /tmp/behat-wordpress`
80
81
81
-
When I run `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib WP_CORE_DIR=/tmp/behat-wordpress /usr/bin/env bash {WORK_DIR}/templates/install-wp-tests.sh wordpress_behat_test root '' localhost trunk`
82
+
When I run `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 wordpress_behat_test root '' localhost trunk`
82
83
Then the return code should be 0
83
84
And the /tmp/behat-wordpress-tests-lib directory should contain:
Then the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
131
-
132
131
When I run `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
133
132
Then the return code should be 0
134
133
135
134
Scenario: Install WordPress 3.7 and phpunit will not run
136
-
Given I run `echo "DROP DATABASE IF EXISTS wordpress_behat_test" | mysql -u root`
135
+
Given a WP install
136
+
And I run `wp plugin path`
137
+
And save STDOUT as {PLUGIN_DIR}
138
+
And I run `wp scaffold plugin hello-world`
139
+
And I run `echo "DROP DATABASE IF EXISTS wordpress_behat_test" | mysql -u root`
137
140
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
138
141
And I try `rm -fr /tmp/behat-wordpress`
139
-
And I run `pwd`
140
-
And save STDOUT as {WORK_DIR}
141
142
142
-
When I run `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib WP_CORE_DIR=/tmp/behat-wordpress /usr/bin/env bash {WORK_DIR}/templates/install-wp-tests.sh wordpress_behat_test root '' localhost 3.7`
143
+
When I run `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 wordpress_behat_test root '' localhost 3.7`
143
144
Then the return code should be 0
144
145
And the /tmp/behat-wordpress-tests-lib directory should contain:
0 commit comments