HEX
Server: Apache
System: Linux iad1-shared-b8-30 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: nicolita (2427845)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: //usr/local/wp/features/validation.feature
Feature: Argument validation
  In order to catch errors fast
  As a user
  I need to see warnings and errors when I pass incorrect arguments

  Scenario: Passing zero arguments to a variadic command
    Given a WP installation

    When I try `wp plugin install`
    Then the return code should be 1
    And STDOUT should contain:
      """
      usage: wp plugin install
      """

  Scenario: Validation for early commands
    Given an empty directory
    And WP files

    When I try `wp core config`
    Then the return code should be 1
    And STDERR should contain:
      """
      Parameter errors:
      """
    And STDERR should contain:
      """
      missing --dbname parameter
      """

    When I try `wp core config --invalid --other-invalid`
    Then the return code should be 1
    And STDERR should contain:
      """
      unknown --invalid parameter
      """
    And STDERR should contain:
      """
      unknown --other-invalid parameter
      """

    When I try `wp core version invalid`
    Then the return code should be 1
    And STDERR should contain:
      """
      Error: Too many positional arguments: invalid
      """
    And STDOUT should be empty