extension-command/features/plugin-list-wporg-status.feature
Janw Oostendorp 12618c730c
Support 'wporg_status' and 'wporg_last_updated' as optional wp plugin list fields (#382)
* Plugins show their .org status.

* Split the fields to check for wporg and date seperatatly.

* Temp behat file to check

* Added hints for behat that need to be implemented.

* phpcs fixes.

* Also add wp-org checks to mu-plugins.

* Added behat tests.

* Allow to select the status on wporg as a single field.

* Added Behat tests.

* Better check for active plugins.

* Renamed wporg keys

* Replaced the api.wp call with the appropriate class.

* replaced test plugin Akismet, because it's failing php version tests.

* Fixed a missed rename.

* Dropins need a hardcoded exception for wp.org status.

* Removed all no_wp_org key words.

* Fix the feature name in Behat

* Add an example to the command doc

* Regenerate README

---------

Co-authored-by: Daniel Bachhuber <daniel.bachhuber@automattic.com>
2023-12-12 15:16:51 -08:00

41 lines
1.7 KiB
Gherkin

Feature: Check the status of plugins on WordPress.org
@require-wp-5.2
Scenario: Install plugins and check the status on wp.org.
Given a WP install
When I run `wp plugin install wordpress-importer --version=0.5 --force`
And I run `wp plugin install https://downloads.wordpress.org/plugin/no-longer-in-directory.1.0.62.zip`
And a wp-content/plugins/never-wporg/never-wporg.php file:
"""
<?php
/**
* Plugin Name: This plugin was never in the WordPress.org plugin directory
* Version: 2.0.2
*/
"""
When I run `wp plugin list --name=wordpress-importer --field=wporg_last_updated`
Then STDOUT should not be empty
And save STDOUT as {COMMIT_DATE}
When I run `wp plugin list --fields=name,wporg_status`
Then STDOUT should be a table containing rows:
| name | wporg_status |
| wordpress-importer | active |
| no-longer-in-directory | closed |
| never-wporg | |
When I run `wp plugin list --fields=name,wporg_last_updated`
Then STDOUT should be a table containing rows:
| name | wporg_last_updated |
| wordpress-importer | {COMMIT_DATE} |
| no-longer-in-directory | 2017-11-13 |
| never-wporg | |
When I run `wp plugin list --fields=name,wporg_status,wporg_last_updated`
Then STDOUT should be a table containing rows:
| name | wporg_status | wporg_last_updated |
| wordpress-importer | active | {COMMIT_DATE} |
| no-longer-in-directory | closed | 2017-11-13 |
| never-wporg | | |