You are here

public function ProcessFailedExceptionTest::testProcessFailedExceptionThrowsException in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/process/Tests/ProcessFailedExceptionTest.php \Symfony\Component\Process\Tests\ProcessFailedExceptionTest::testProcessFailedExceptionThrowsException()

tests ProcessFailedException throws exception if the process was successful.

File

vendor/symfony/process/Tests/ProcessFailedExceptionTest.php, line 24

Class

ProcessFailedExceptionTest
@author Sebastian Marek <proofek@gmail.com>

Namespace

Symfony\Component\Process\Tests

Code

public function testProcessFailedExceptionThrowsException() {
  $process = $this
    ->getMock('Symfony\\Component\\Process\\Process', array(
    'isSuccessful',
  ), array(
    'php',
  ));
  $process
    ->expects($this
    ->once())
    ->method('isSuccessful')
    ->will($this
    ->returnValue(true));
  $this
    ->setExpectedException('\\InvalidArgumentException', 'Expected a failed process, but the given process was successful.');
  new ProcessFailedException($process);
}