Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CommandIsSuccessful.php

class CommandIsSuccessful

Hierarchy

  • class \PHPUnit\Framework\Constraint\Constraint implements \Countable, \PHPUnit\Framework\SelfDescribing
    • class \Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful extends \PHPUnit\Framework\Constraint\Constraint

Expanded class hierarchy of CommandIsSuccessful

1 file declares its use of CommandIsSuccessful
TesterTrait.php in vendor/symfony/console/Tester/TesterTrait.php

File

vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php, line 17

Namespace

Symfony\Component\Console\Tester\Constraint
View source
final class CommandIsSuccessful extends Constraint {
    public function toString() : string {
        return 'is successful';
    }
    protected function matches($other) : bool {
        return Command::SUCCESS === $other;
    }
    protected function failureDescription($other) : string {
        return 'the command ' . $this->toString();
    }
    protected function additionalFailureDescription($other) : string {
        $mapping = [
            Command::FAILURE => 'Command failed.',
            Command::INVALID => 'Command was invalid.',
        ];
        return $mapping[$other] ?? \sprintf('Command returned exit status %d.', $other);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
CommandIsSuccessful::additionalFailureDescription protected function Return additional failure description where needed. Overrides Constraint::additionalFailureDescription
CommandIsSuccessful::failureDescription protected function Returns the description of the failure. Overrides Constraint::failureDescription
CommandIsSuccessful::matches protected function Evaluates the constraint for parameter $other. Returns true if the
constraint is met, false otherwise.
Overrides Constraint::matches
CommandIsSuccessful::toString public function Returns a string representation of the object. Overrides SelfDescribing::toString
Constraint::count public function Counts the number of constraint elements. 3
Constraint::evaluate public function Evaluates the constraint for parameter $other. 7
Constraint::exporter protected function
Constraint::fail protected function Throws an exception for the given compared value and test description. 1
Constraint::failureDescriptionInContext protected function Returns the description of the failure when this constraint appears in
context of an $operator expression.
Constraint::reduce protected function Reduces the sub-expression starting at $this by skipping degenerate
sub-expression and returns first descendant constraint that starts
a non-reducible sub-expression.
2
Constraint::toStringInContext protected function Returns a custom string representation of the constraint object when it
appears in context of an $operator expression.
Constraint::valueToTypeStringFragment protected function @psalm-return non-empty-string

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal