ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/.wp-cli/packages/vendor/wp-cli/entity-command/features/menu-location.feature
Feature: Manage WordPress menu locations

  Background:
    Given a WP install
    And I run `wp theme delete --all --force`
    And I run `wp theme install twentytwelve --activate`

  Scenario: Assign / remove location from a menu
    When I run `wp menu location list`
    Then STDOUT should be a table containing rows:
      | location       | description        |
      | primary        | Primary Menu       |

    When I run `wp menu create "Primary Menu"`
    And I run `wp menu location assign primary-menu primary`
    And I run `wp menu list --fields=slug,locations`
    Then STDOUT should be a table containing rows:
      | slug            | locations       |
      | primary-menu    | primary         |

    When I run `wp menu location list --format=ids`
    Then STDOUT should be:
      """
      primary
      """

    When I run `wp menu location remove primary-menu primary`
    And I run `wp menu list --fields=slug,locations`
    Then STDOUT should be a table containing rows:
      | slug            | locations       |
      | primary-menu    |                 |

    When I try `wp menu location assign secondary-menu secondary`
    Then STDERR should be:
      """
      Error: Invalid menu secondary-menu.
      """
    And the return code should be 1

    When I run `wp menu create "Secondary Menu"`
    And I try `wp menu location assign secondary-menu secondary`
    Then STDERR should be:
      """
      Error: Invalid location secondary.
      """
    And the return code should be 1

    When I run `wp menu location assign secondary-menu primary`
    Then STDOUT should be:
      """
      Success: Assigned location primary to menu secondary-menu.
      """

    When I run `wp menu list --fields=slug,locations`
    Then STDOUT should be a table containing rows:
      | slug            | locations       |
      | primary-menu    |                 |
      | secondary-menu  | primary         |