-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathplugin-check-update.feature
More file actions
101 lines (80 loc) · 2.86 KB
/
plugin-check-update.feature
File metadata and controls
101 lines (80 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Feature: Check for plugin updates
@require-wp-5.2
Scenario: Check for plugin updates with no updates available
Given a WP install
When I run `wp plugin install wordpress-importer --activate`
Then STDOUT should not be empty
When I run `wp plugin check-update --all`
Then STDOUT should contain:
"""
Success: All plugins are up to date.
"""
When I run `wp plugin check-update wordpress-importer`
Then STDOUT should contain:
"""
Success: All plugins are up to date.
"""
Scenario: Check for plugin updates should throw an error unless --all given
Given a WP install
When I try `wp plugin check-update`
Then the return code should be 1
And STDERR should be:
"""
Error: Please specify one or more plugins, or use --all.
"""
And STDOUT should be empty
@require-wp-5.2
Scenario: Check for specific plugin updates
Given a WP install
When I run `wp plugin install wordpress-importer --version=0.5`
Then STDOUT should not be empty
When I run `wp plugin check-update wordpress-importer --format=csv`
Then STDOUT should contain:
"""
wordpress-importer,inactive,0.5,
"""
@require-wp-5.2
Scenario: Check for all plugin updates with --all flag
Given a WP install
When I run `wp plugin install wordpress-importer --version=0.5 --activate`
Then STDOUT should not be empty
When I run `wp plugin check-update --all --format=csv`
Then STDOUT should contain:
"""
wordpress-importer,active,0.5,
"""
@require-wp-5.2
Scenario: Check for plugin updates in different output formats
Given a WP install
When I run `wp plugin install wordpress-importer --version=0.5`
Then STDOUT should not be empty
When I run `wp plugin check-update wordpress-importer --format=json`
Then STDOUT should be JSON containing:
"""
[{"name":"wordpress-importer","status":"inactive","version":"0.5"}]
"""
When I run `wp plugin check-update wordpress-importer --format=csv`
Then STDOUT should contain:
"""
name,status,version,update_version
"""
And STDOUT should contain:
"""
wordpress-importer,inactive,0.5
"""
@require-wp-5.2
Scenario: Check for plugin updates with custom fields
Given a WP install
When I run `wp plugin install wordpress-importer --version=0.5`
Then STDOUT should not be empty
When I run `wp plugin check-update wordpress-importer --fields=name,version`
Then STDOUT should be a table containing rows:
| name | version |
| wordpress-importer | 0.5 |
Scenario: Check for invalid plugin should error
Given a WP install
When I try `wp plugin check-update invalid-plugin-name`
Then STDERR should contain:
"""
Warning: The 'invalid-plugin-name' plugin could not be found.
"""