endtoend-test-psl/tests/Psl/Shell/Exception/FailedExecutionExceptionTest.php

23 lines
676 B
PHP
Raw Normal View History

2021-02-22 02:33:21 +01:00
<?php
declare(strict_types=1);
namespace Psl\Tests\Shell\Exception;
use PHPUnit\Framework\TestCase;
use Psl\Shell\Exception;
final class FailedExecutionExceptionTest extends TestCase
{
public function testMethods(): void
{
$exception = new Exception\FailedExecutionException('foo', 'bar', 'baz', 4);
static::assertSame('Shell command "foo" returned an exit code of "4".', $exception->getMessage());
static::assertSame('foo', $exception->getCommand());
static::assertSame('bar', $exception->getOutput());
static::assertSame('baz', $exception->getErrorOutput());
static::assertSame(4, $exception->getCode());
}
}