Skip to content

Commit e491918

Browse files
committed
Add feature test for plugin get command
1 parent 0a7602b commit e491918

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

features/plugin-get.feature

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Feature: Get WordPress plugin
2+
3+
Scenario: Get plugin info
4+
Given a WP install
5+
And a wp-content/plugins/foo.php file:
6+
"""
7+
/**
8+
* Plugin Name: Sample Plugin
9+
* Description: Description for sample plugin.
10+
* Requires at least: 6.0
11+
* Requires PHP: 5.6
12+
* Version: 1.0.0
13+
* Author: John Doe
14+
* Author URI: https://example.com/
15+
* License: GPLv2 or later
16+
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
17+
* Text Domain: sample-plugin
18+
*/
19+
"""
20+
21+
When I run `wp plugin get foo --fields=name,author,version,status`
22+
Then STDOUT should be a table containing rows:
23+
| Field | Value |
24+
| name | foo |
25+
| author | John Doe |
26+
| version | 1.0.0 |
27+
| status | inactive |
28+
29+
@require-wp-6.5
30+
Scenario: Get Requires Plugins header of plugin
31+
Given a WP install
32+
And a wp-content/plugins/foo.php file:
33+
"""
34+
<?php
35+
/**
36+
* Plugin Name: Foo
37+
* Description: Foo plugin
38+
* Author: John Doe
39+
* Requires Plugins: jetpack, woocommerce
40+
*/
41+
"""
42+
43+
When I run `wp plugin get foo --field=requires_plugins`
44+
Then STDOUT should be:
45+
"""
46+
jetpack, woocommerce
47+
"""

0 commit comments

Comments
 (0)