Skip to content

Commit 41944d8

Browse files
committed
Merge branch 'main' into 113_add_ssl_flag
2 parents 606a34e + c99b4fb commit 41944d8

10 files changed

Lines changed: 226 additions & 331 deletions

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
},
2323
"require-dev": {
2424
"wp-cli/db-command": "^1.3 || ^2",
25-
"wp-cli/wp-cli-tests": "^4.2.8"
25+
"wp-cli/wp-cli-tests": "^5"
2626
},
2727
"config": {
2828
"process-timeout": 7200,
2929
"sort-packages": true,
3030
"allow-plugins": {
3131
"dealerdirect/phpcodesniffer-composer-installer": true,
32-
"johnpbloch/wordpress-core-installer": true
32+
"johnpbloch/wordpress-core-installer": true,
33+
"phpstan/extension-installer": true
3334
},
3435
"lock": false
3536
},
@@ -67,12 +68,14 @@
6768
"behat-rerun": "rerun-behat-tests",
6869
"lint": "run-linter-tests",
6970
"phpcs": "run-phpcs-tests",
71+
"phpstan": "run-phpstan-tests",
7072
"phpcbf": "run-phpcbf-cleanup",
7173
"phpunit": "run-php-unit-tests",
7274
"prepare-tests": "install-package-tests",
7375
"test": [
7476
"@lint",
7577
"@phpcs",
78+
"@phpstan",
7679
"@phpunit",
7780
"@behat"
7881
]

features/config-create.feature

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Feature: Create a wp-config file
9090
9191
When I try `wp version`
9292
Then STDERR should not contain:
93-
"""
94-
Constant WP_DEBUG already defined
95-
"""
93+
"""
94+
Constant WP_DEBUG already defined
95+
"""
9696
9797
@require-wp-4.0
9898
Scenario: No wp-config.php and WPLANG
@@ -227,56 +227,6 @@ Feature: Create a wp-config file
227227
define( 'AUTH_SALT',
228228
"""
229229
230-
@less-than-php-7.0
231-
Scenario: Configure with salts fetched from WordPress.org
232-
Given an empty directory
233-
And WP files
234-
235-
When I run `wp config create {CORE_CONFIG_SETTINGS}`
236-
Then the wp-config.php file should contain:
237-
"""
238-
define( 'AUTH_SALT',
239-
"""
240-
241-
Scenario: Define WPLANG when running WP < 4.0
242-
Given an empty directory
243-
And I run `wp core download --version=3.9 --force`
244-
245-
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check`
246-
Then the wp-config.php file should contain:
247-
"""
248-
define( 'WPLANG', '' );
249-
"""
250-
251-
When I try `wp config create {CORE_CONFIG_SETTINGS}`
252-
Then the return code should be 1
253-
And STDERR should contain:
254-
"""
255-
Error: The 'wp-config.php' file already exists.
256-
"""
257-
258-
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --locale=ja --force`
259-
Then the return code should be 0
260-
And STDOUT should contain:
261-
"""
262-
Success: Generated 'wp-config.php' file.
263-
"""
264-
And the wp-config.php file should contain:
265-
"""
266-
define( 'WPLANG', 'ja' );
267-
"""
268-
269-
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --config-file=wp-custom-config.php --locale=ja --force`
270-
Then the return code should be 0
271-
And STDOUT should contain:
272-
"""
273-
Success: Generated 'wp-custom-config.php' file.
274-
"""
275-
And the wp-custom-config.php file should contain:
276-
"""
277-
define( 'WPLANG', 'ja' );
278-
"""
279-
280230
Scenario: Values are properly escaped to avoid creating invalid config files
281231
Given an empty directory
282232
And WP files

features/config-is-true.feature

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Feature: Determine whether the value of a constant or variable defined in wp-con
3737
Scenario Outline: Get the value of a variable whose value is true
3838
When I try `wp config is-true <variable>`
3939
Then STDOUT should be empty
40-
Then STDERR should be empty
40+
And STDERR should be empty
4141
And the return code should be 0
4242

4343
Examples:
@@ -75,10 +75,9 @@ Feature: Determine whether the value of a constant or variable defined in wp-con
7575
Scenario: Test for correct functionality with included PHP files.
7676
When I try `wp config is-true WP_INC_TRUTH`
7777
Then STDOUT should be empty
78-
Then STDERR should be empty
78+
And STDERR should be empty
7979
And the return code should be 0
8080

8181
When I try `wp config is-true WP_INC_FALSE`
8282
Then STDOUT should be empty
8383
And the return code should be 1
84-

features/config-list.feature

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ Feature: List the values of a wp-config.php file
100100
| DB_HOST |
101101
| DB_CHARSET |
102102
| DB_COLLATE |
103-
Then STDOUT should not contain:
103+
And STDOUT should not contain:
104104
"""
105105
table_prefix
106106
"""
107-
Then STDOUT should not contain:
107+
And STDOUT should not contain:
108108
"""
109109
AUTH_KEY
110110
"""
@@ -113,15 +113,15 @@ Feature: List the values of a wp-config.php file
113113
Then STDOUT should be a table containing rows:
114114
| name |
115115
| DB_HOST |
116-
Then STDOUT should not contain:
116+
And STDOUT should not contain:
117117
"""
118118
table_prefix
119119
"""
120-
Then STDOUT should not contain:
120+
And STDOUT should not contain:
121121
"""
122122
AUTH_KEY
123123
"""
124-
Then STDOUT should not contain:
124+
And STDOUT should not contain:
125125
"""
126126
DB_NAME
127127
"""
@@ -143,15 +143,15 @@ Feature: List the values of a wp-config.php file
143143
| name |
144144
| DB_USER |
145145
| DB_PASSWORD |
146-
Then STDOUT should not contain:
146+
And STDOUT should not contain:
147147
"""
148148
table_prefix
149149
"""
150-
Then STDOUT should not contain:
150+
And STDOUT should not contain:
151151
"""
152152
AUTH_KEY
153153
"""
154-
Then STDOUT should not contain:
154+
And STDOUT should not contain:
155155
"""
156156
DB_HOST
157157
"""
@@ -161,15 +161,15 @@ Feature: List the values of a wp-config.php file
161161
| name |
162162
| DB_USER |
163163
| DB_PASSWORD |
164-
Then STDOUT should not contain:
164+
And STDOUT should not contain:
165165
"""
166166
table_prefix
167167
"""
168-
Then STDOUT should not contain:
168+
And STDOUT should not contain:
169169
"""
170170
AUTH_KEY
171171
"""
172-
Then STDOUT should not contain:
172+
And STDOUT should not contain:
173173
"""
174174
DB_HOST
175175
"""
@@ -185,11 +185,11 @@ Feature: List the values of a wp-config.php file
185185
| SECURE_AUTH_SALT |
186186
| LOGGED_IN_SALT |
187187
| NONCE_SALT |
188-
Then STDOUT should not contain:
188+
And STDOUT should not contain:
189189
"""
190190
table_prefix
191191
"""
192-
Then STDOUT should not contain:
192+
And STDOUT should not contain:
193193
"""
194194
DB_HOST
195195
"""
@@ -232,11 +232,11 @@ Feature: List the values of a wp-config.php file
232232
| DB_HOST |
233233
| DB_CHARSET |
234234
| DB_COLLATE |
235-
Then STDOUT should not contain:
235+
And STDOUT should not contain:
236236
"""
237237
table_prefix
238238
"""
239-
Then STDOUT should not contain:
239+
And STDOUT should not contain:
240240
"""
241241
AUTH_KEY
242242
"""
@@ -245,15 +245,15 @@ Feature: List the values of a wp-config.php file
245245
Then STDOUT should be a table containing rows:
246246
| name |
247247
| DB_HOST |
248-
Then STDOUT should not contain:
248+
And STDOUT should not contain:
249249
"""
250250
table_prefix
251251
"""
252-
Then STDOUT should not contain:
252+
And STDOUT should not contain:
253253
"""
254254
AUTH_KEY
255255
"""
256-
Then STDOUT should not contain:
256+
And STDOUT should not contain:
257257
"""
258258
DB_NAME
259259
"""
@@ -275,15 +275,15 @@ Feature: List the values of a wp-config.php file
275275
| name |
276276
| DB_USER |
277277
| DB_PASSWORD |
278-
Then STDOUT should not contain:
278+
And STDOUT should not contain:
279279
"""
280280
table_prefix
281281
"""
282-
Then STDOUT should not contain:
282+
And STDOUT should not contain:
283283
"""
284284
AUTH_KEY
285285
"""
286-
Then STDOUT should not contain:
286+
And STDOUT should not contain:
287287
"""
288288
DB_HOST
289289
"""
@@ -293,15 +293,15 @@ Feature: List the values of a wp-config.php file
293293
| name |
294294
| DB_USER |
295295
| DB_PASSWORD |
296-
Then STDOUT should not contain:
296+
And STDOUT should not contain:
297297
"""
298298
table_prefix
299299
"""
300-
Then STDOUT should not contain:
300+
And STDOUT should not contain:
301301
"""
302302
AUTH_KEY
303303
"""
304-
Then STDOUT should not contain:
304+
And STDOUT should not contain:
305305
"""
306306
DB_HOST
307307
"""
@@ -317,11 +317,11 @@ Feature: List the values of a wp-config.php file
317317
| SECURE_AUTH_SALT |
318318
| LOGGED_IN_SALT |
319319
| NONCE_SALT |
320-
Then STDOUT should not contain:
320+
And STDOUT should not contain:
321321
"""
322322
table_prefix
323323
"""
324-
Then STDOUT should not contain:
324+
And STDOUT should not contain:
325325
"""
326326
DB_HOST
327327
"""

features/config-set.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ Feature: Set the value of a constant or variable defined in wp-config.php file a
383383
require_once( ABSPATH . 'wp-settings.php' );
384384
"""
385385

386-
Scenario: Additions can be properly placed in wp-custom-config.php
386+
Scenario: Additions can be properly placed in wp-custom-config.php
387387
Given a WP install
388388
And a wp-custom-config.php file:
389389
"""

0 commit comments

Comments
 (0)