-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #414 from ernilambar/update/plugin-get-deps
- Loading branch information
Showing
3 changed files
with
131 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters