Skip to content

Commit 4e3d71b

Browse files
Copilotswissspidy
andcommitted
Add Behat tests for auto-update-indicated feature
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 5a4ad4e commit 4e3d71b

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

features/plugin-update.feature

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,52 @@ Feature: Update WordPress plugins
267267
"""
268268
Success: Updated 1 of 1 plugins (1 skipped).
269269
"""
270+
271+
@require-wp-5.2
272+
Scenario: Show auto_update_indicated field in plugin list
273+
Given a WP install
274+
275+
When I run `wp plugin install wordpress-importer --version=0.5 --force`
276+
Then STDOUT should not be empty
277+
278+
When I run `wp plugin list --fields=name,version,update,auto_update_indicated`
279+
Then STDOUT should be a table containing rows:
280+
| name | version | update | auto_update_indicated |
281+
| wordpress-importer | 0.5 | available | no |
282+
283+
@require-wp-5.2
284+
Scenario: Using --auto-update-indicated flag when no plugins have auto-update indicated
285+
Given a WP install
286+
287+
When I run `wp plugin install wordpress-importer --version=0.5 --force`
288+
Then STDOUT should not be empty
289+
290+
When I run `wp plugin update --auto-update-indicated`
291+
Then STDOUT should be:
292+
"""
293+
Success: No plugins with server-indicated automatic updates available.
294+
"""
295+
296+
@require-wp-5.2
297+
Scenario: Error when using --version with --auto-update-indicated
298+
Given a WP install
299+
300+
When I try `wp plugin update --auto-update-indicated --version=1.0.0`
301+
Then STDERR should be:
302+
"""
303+
Error: Cannot use --version with --auto-update-indicated. The version is determined by the server.
304+
"""
305+
And the return code should be 1
306+
307+
@require-wp-5.2
308+
Scenario: Preview updates with --auto-update-indicated and --dry-run
309+
Given a WP install
310+
311+
When I run `wp plugin install wordpress-importer --version=0.5 --force`
312+
Then STDOUT should not be empty
313+
314+
When I run `wp plugin update --auto-update-indicated --dry-run`
315+
Then STDOUT should be:
316+
"""
317+
Success: No plugins with server-indicated automatic updates available.
318+
"""

0 commit comments

Comments
 (0)