Skip to content

Commit c5c0860

Browse files
committed
Add test to replicate issue
1 parent 0c6b559 commit c5c0860

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

features/plugin-activate.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,26 @@ Feature: Activate WordPress plugins
148148
Success:
149149
"""
150150
And the return code should be 0
151+
152+
Scenario: Incompatible plugins cannot be activated
153+
Given a WP installation
154+
And a wp-content/plugins/incompatible-plugin.php file:
155+
"""
156+
<?php
157+
/**
158+
* Plugin Name: Incompatible Plugin
159+
* Requires PHP: 42.0
160+
*/
161+
"""
162+
And I run `wp cli info | grep "PHP version" | awk '{print $3}'`
163+
And save STDOUT as {PHP_VERSION}
164+
165+
When I try `wp plugin activate incompatible-plugin`
166+
Then STDERR should contain:
167+
"""
168+
Failed to activate plugin. Current PHP version ({PHP_VERSION}) does not meet minimum requirements for Incompatible Plugin. The plugin requires PHP 42.0.
169+
"""
170+
And STDOUT should not contain:
171+
"""
172+
Success:
173+
"""

0 commit comments

Comments
 (0)