Skip to content

Commit deaf9c9

Browse files
Copilotswissspidy
andcommitted
Simplify install test - use activate --force instead of reinstalling from zip
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 8e58bc2 commit deaf9c9

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

features/plugin-install.feature

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Feature: Install WordPress plugins
306306
active
307307
"""
308308

309-
Scenario: Force reinstall and activate an already active plugin to re-run activation hooks
309+
Scenario: Force activate an already active plugin to re-run activation hooks
310310
Given a WP install
311311
And a wp-content/plugins/install-force-test/install-force-test.php file:
312312
"""
@@ -333,32 +333,9 @@ Feature: Install WordPress plugins
333333
# Remove the file to test if it gets recreated with --force
334334
When I run `rm wp-content/install-activation-test.txt`
335335

336-
# Create a zip of the plugin for reinstallation
337-
When I run `cd wp-content/plugins && zip -r /tmp/install-force-test.zip install-force-test`
338-
339-
# Try install --activate without --force (should skip activation hooks)
340-
When I run `wp plugin install /tmp/install-force-test.zip --activate`
341-
Then STDOUT should contain:
342-
"""
343-
Unpacking the package...
344-
"""
345-
And STDOUT should contain:
346-
"""
347-
Activating 'install-force-test'...
348-
"""
349-
And STDERR should contain:
350-
"""
351-
Warning: Plugin 'install-force-test' is already active.
352-
"""
353-
And the wp-content/install-activation-test.txt file should not exist
354-
355-
# Now try install --activate --force (should re-run activation hooks)
356-
When I run `wp plugin install /tmp/install-force-test.zip --activate --force`
336+
# Now try activate --force (should re-run activation hooks)
337+
When I run `wp plugin activate install-force-test --force`
357338
Then STDOUT should contain:
358-
"""
359-
Activating 'install-force-test'...
360-
"""
361-
And STDOUT should contain:
362339
"""
363340
Plugin 'install-force-test' activated.
364341
"""

0 commit comments

Comments
 (0)