You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 37f9901
Browse filesBrowse the repository at this point in the historyBrowse files
# Once the update data is refreshed without the plugin's update mechanism, the plugin must not be mistaken for being up to date.
494
+
When I try `wp transient delete update_plugins --network`
495
+
And I try `wp plugin update premium-updater-simulation --skip-plugins`
496
+
Then STDERR should be:
497
+
"""
498
+
Warning: premium-updater-simulation: Could not determine whether an update is available. The plugin's own update mechanism might not have run because --skip-plugins is in effect.
499
+
Error: No plugins updated.
500
+
"""
501
+
And STDOUT should be empty
502
+
And the return code should be 1
503
+
504
+
# Plugins that WordPress.org reported on are not affected.
505
+
When I try `wp plugin update --all --skip-plugins --dry-run`
506
+
Then STDERR should contain:
507
+
"""
508
+
Warning: premium-updater-simulation: Could not determine whether an update is available. The plugin's own update mechanism might not have run because --skip-plugins is in effect.
509
+
"""
510
+
511
+
# Excluded plugins are not warned about.
512
+
When I try `wp plugin update --all --skip-plugins --exclude=premium-updater-simulation --dry-run`
513
+
Then STDERR should not contain:
514
+
"""
515
+
premium-updater-simulation
516
+
"""
517
+
518
+
# Update data fetched while plugins were skipped is not reused once plugins are loaded again.
519
+
When I try `wp plugin update premium-updater-simulation`
520
+
Then STDERR should contain:
521
+
"""
522
+
Warning: Update package not available.
523
+
"""
524
+
And STDERR should contain:
525
+
"""
526
+
Error: No plugins updated (1 failed).
527
+
"""
528
+
And the return code should be 1
529
+
530
+
# Skipping other plugins leaves the plugin's update mechanism running.
531
+
When I try `wp transient delete update_plugins --network`
532
+
And I try `wp plugin update premium-updater-simulation --skip-plugins=akismet`
# Once the update data is refreshed without the theme's update mechanism, the theme must not be mistaken for being up to date.
350
+
When I try `wp transient delete update_themes --network`
351
+
And I try `wp theme update premium-theme-simulation --skip-themes`
352
+
Then STDERR should be:
353
+
"""
354
+
Warning: premium-theme-simulation: Could not determine whether an update is available. The theme's own update mechanism might not have run because --skip-themes is in effect.
355
+
Error: No themes updated.
356
+
"""
357
+
And STDOUT should be empty
358
+
And the return code should be 1
359
+
360
+
# Update data fetched while themes were skipped is not reused once themes are loaded again.
361
+
When I try `wp theme update premium-theme-simulation`
362
+
Then STDERR should contain:
363
+
"""
364
+
Warning: Update package not available.
365
+
"""
366
+
And STDERR should contain:
367
+
"""
368
+
Error: No themes updated (1 failed).
369
+
"""
370
+
And the return code should be 1
371
+
372
+
Scenario: Updating a theme whose update mechanism lives in a skipped companion plugin
373
+
Given a WP install
374
+
And a wp-content/themes/premium-theme-simulation/style.css file:
375
+
"""
376
+
/*
377
+
Theme Name: Premium Theme Simulation
378
+
Description: Mimics a premium theme whose updates are provided by a companion plugin.
379
+
Version: 1.0.0
380
+
*/
381
+
"""
382
+
And a wp-content/themes/premium-theme-simulation/index.php file:
383
+
"""
384
+
<?php
385
+
"""
386
+
And a wp-content/plugins/premium-theme-updater/premium-theme-updater.php file:
387
+
"""
388
+
<?php
389
+
/**
390
+
* Plugin Name: Premium Theme Updater
391
+
* Description: Mimics a companion plugin providing updates for a premium theme.
And I run `wp plugin activate premium-theme-updater`
414
+
And I try `wp transient delete update_themes --network`
415
+
416
+
When I try `wp theme update premium-theme-simulation`
417
+
Then STDERR should contain:
418
+
"""
419
+
Warning: Update package not available.
420
+
"""
421
+
And STDERR should contain:
422
+
"""
423
+
Error: No themes updated (1 failed).
424
+
"""
425
+
And the return code should be 1
426
+
427
+
When I try `wp transient delete update_themes --network`
428
+
And I try `wp theme update premium-theme-simulation --skip-plugins`
429
+
Then STDERR should be:
430
+
"""
431
+
Warning: premium-theme-simulation: Could not determine whether an update is available. The theme's own update mechanism might not have run because --skip-plugins is in effect.
432
+
Error: No themes updated.
433
+
"""
434
+
And the return code should be 1
435
+
436
+
When I try `wp theme update premium-theme-simulation --skip-plugins --skip-themes`
437
+
Then STDERR should be:
438
+
"""
439
+
Warning: premium-theme-simulation: Could not determine whether an update is available. The theme's own update mechanism might not have run because --skip-plugins and --skip-themes are in effect.
440
+
Error: No themes updated.
441
+
"""
442
+
And the return code should be 1
443
+
444
+
# Skipping only unrelated themes leaves the companion plugin running.
445
+
When I try `wp theme update premium-theme-simulation --skip-themes=twentytwentyfive`
0 commit comments