public function ProcessFailedExceptionTest::testProcessFailedExceptionThrowsException

tests ProcessFailedException throws exception if the process was successful

File

drupal/core/vendor/symfony/process/Symfony/Component/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);
}