-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathplugin-get.feature
More file actions
74 lines (67 loc) · 2.03 KB
/
plugin-get.feature
File metadata and controls
74 lines (67 loc) · 2.03 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
Feature: Get WordPress plugin
Scenario: Get plugin info
Given a WP install
And a wp-content/plugins/foo.php file:
"""
/**
* Plugin Name: Sample Plugin
* Description: Description for sample plugin.
* Requires at least: 6.0
* Requires PHP: 5.6
* Version: 1.0.0
* Author: John Doe
* Author URI: https://example.com/
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* Text Domain: sample-plugin
*/
"""
When I run `wp plugin get foo --fields=name,author,version,status`
Then STDOUT should be a table containing rows:
| Field | Value |
| name | foo |
| author | John Doe |
| version | 1.0.0 |
| status | inactive |
When I run `wp plugin get foo --format=json`
Then STDOUT should be:
"""
{"name":"foo","title":"Sample Plugin","author":"John Doe","version":"1.0.0","description":"Description for sample plugin.","status":"inactive"}
"""
@require-wp-6.5
Scenario: Get Requires Plugins header of plugin
Given a WP install
And a wp-content/plugins/foo.php file:
"""
<?php
/**
* Plugin Name: Foo
* Description: Foo plugin
* Author: John Doe
* Requires Plugins: jetpack, woocommerce
*/
"""
When I run `wp plugin get foo --field=requires_plugins`
Then STDOUT should be:
"""
jetpack, woocommerce
"""
@require-wp-5.3
Scenario: Get Requires PHP and Requires WP header of plugin
Given a WP install
And a wp-content/plugins/foo.php file:
"""
<?php
/**
* Plugin Name: Foo
* Description: Foo plugin
* Author: John Doe
* Requires at least: 6.2
* Requires PHP: 7.4
*/
"""
When I run `wp plugin get foo --fields=requires_wp,requires_php`
Then STDOUT should be a table containing rows:
| Field | Value |
| requires_wp | 6.2 |
| requires_php | 7.4 |