Skip to content

Commit 6b20309

Browse files
Nikschavanschlessera
authored andcommitted
Add tests to check the flag does skip update check
1 parent 50deb81 commit 6b20309

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

features/plugin.feature

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,34 @@ Feature: Manage WordPress plugins
341341
| akismet | active | akismet/akismet.php |
342342
| wordpress-importer | inactive | wordpress-importer/wordpress-importer.php |
343343

344+
Scenario: Flag `--skip-update-check` skips update check when running `wp plugin list`
345+
Given a WP install
346+
347+
When I run `wp plugin install wordpress-importer --version=0.2`
348+
Then STDOUT should contain:
349+
"""
350+
Plugin installed successfully.
351+
"""
352+
353+
When I run `wp plugin list --fields=name,status,update`
354+
Then STDOUT should be table containing rows:
355+
---------------------+----------+-----------+
356+
| name | status | update |
357+
---------------------+----------+-----------+
358+
| wordpress-importer | inactive | available |
359+
---------------------+----------+-----------+
360+
361+
When I run `wp transient delete update_plugins`
362+
Success: Transient deleted.
363+
364+
When I run `wp plugin list --fields=name,status,update --skip-update-check`
365+
Then STDOUT should be table containing rows:
366+
---------------------+----------+-----------+
367+
| name | status | update |
368+
---------------------+----------+-----------+
369+
| wordpress-importer | inactive | none |
370+
---------------------+----------+-----------+
371+
344372
Scenario: Install a plugin when directory doesn't yet exist
345373
Given a WP install
346374

features/theme.feature

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,34 @@ Feature: Manage WordPress themes
178178
And STDOUT should be empty
179179
And the return code should be 0
180180
181+
Scenario: Flag `--skip-update-check` skips update check when running `wp theme list`
182+
Given a WP install
183+
184+
When I run `wp theme install astra --version=1.0.0`
185+
Then STDOUT should contain:
186+
"""
187+
Theme installed successfully.
188+
"""
189+
190+
When I run `wp theme list --fields=name,status,update`
191+
Then STDOUT should be table containing rows:
192+
--------+----------+------------
193+
| name | status | update |
194+
--------+----------+------------
195+
| astra | inactive | available |
196+
--------+----------+------------
197+
198+
When I run `wp transient delete update_themes`
199+
Success: Transient deleted.
200+
201+
When I run `wp theme list --fields=name,status,update --skip-update-check`
202+
Then STDOUT should be table containing rows:
203+
+-------+----------+--------+
204+
| name | status | update |
205+
+-------+----------+--------+
206+
| astra | inactive | none |
207+
+-------+----------+--------+
208+
181209
Scenario: Install a theme when the theme directory doesn't yet exist
182210
Given a WP install
183211

0 commit comments

Comments
 (0)