HEX
Server: LiteSpeed
System: Linux us-phx-web629.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64
User: u756937133 (756937133)
PHP: 8.2.30
Disabled: passthru,chgrp
Upload Files
File: //opt/.wp-cli/packages/vendor/wp-cli/doctor-command/features/check-network-required-plugins.feature
Feature: Check required network plugins

  Scenario: Verify check description
    Given an empty directory
    And a config.yml file:
      """
      network-required-plugins:
        check: Network_Required_Plugins
        options:
          plugins:
            - akismet
      """

    When I try `wp doctor list --fields=name,description --config=config.yml`
    Then STDOUT should be a table containing rows:
      | name                     | description                                                  |
      | network-required-plugins | Errors when required plugins are not network-activated.      |

  Scenario: Required plugin is not network-activated
    Given a WP multisite installation
    And a config.yml file:
      """
      network-required-plugins:
        check: Network_Required_Plugins
        options:
          plugins:
            - akismet
      """

    When I try `wp doctor check network-required-plugins --config=config.yml`
    Then STDOUT should be a table containing rows:
      | name                     | status | message                                                                                |
      | network-required-plugins | error  | Required network plugin check failed. Not network-activated: akismet (inactive).      |
    And STDERR should contain:
      """
      Error: 1 check reports 'error'.
      """
    And the return code should be 1

  Scenario: Required plugin is network-activated
    Given a WP multisite installation
    And a config.yml file:
      """
      network-required-plugins:
        check: Network_Required_Plugins
        options:
          plugins:
            - akismet
      """
    And I run `wp plugin activate akismet --network`

    When I run `wp doctor check network-required-plugins --config=config.yml`
    Then STDOUT should be a table containing rows:
      | name                     | status  | message                                            |
      | network-required-plugins | success | All required plugins are network-activated.        |