CoreFiles by mySites.guru
CommandIsSuccessful.php43 lines, 1,056 bytes, from Joomla_5.4.0-beta3-Beta-Full_Package.zip
Raw History Compare with 5.4.0-beta2
md5
95040fc5b1fddda69d8e60e8c5eaf6d0
sha1
2b7c28205a73c8de334200c20de4fa7652e75cfd
sha256
4f41cc9645116dc4c1af7ceab0d366a58f9d5d6fbb87ed96cd560bdeb2c6fa42
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Tester\Constraint;

use PHPUnit\Framework\Constraint\Constraint;
use Symfony\Component\Console\Command\Command;

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);
    }
}

The same content is in 85 releases, Joomla 5.0.0-alpha1 to 6.0.0-alpha3. See them all, or every version of this file.