26 $process = $this->getMock(
27 'Symfony\Component\Process\Process',
28 array(
'isSuccessful'),
31 $process->expects($this->once())
32 ->method(
'isSuccessful')
33 ->will($this->returnValue(
true));
35 $this->setExpectedException(
36 '\InvalidArgumentException',
37 'Expected a failed process, but the given process was successful.' 51 $exitText =
'General error';
53 $errorOutput =
'FATAL: Unexpected error';
54 $workingDirectory = getcwd();
56 $process = $this->getMock(
57 'Symfony\Component\Process\Process',
58 array(
'isSuccessful',
'getOutput',
'getErrorOutput',
'getExitCode',
'getExitCodeText',
'isOutputDisabled',
'getWorkingDirectory'),
61 $process->expects($this->once())
62 ->method(
'isSuccessful')
63 ->will($this->returnValue(
false));
65 $process->expects($this->once())
67 ->will($this->returnValue(
$output));
69 $process->expects($this->once())
70 ->method(
'getErrorOutput')
71 ->will($this->returnValue($errorOutput));
73 $process->expects($this->once())
74 ->method(
'getExitCode')
75 ->will($this->returnValue($exitCode));
77 $process->expects($this->once())
78 ->method(
'getExitCodeText')
79 ->will($this->returnValue($exitText));
81 $process->expects($this->once())
82 ->method(
'isOutputDisabled')
83 ->will($this->returnValue(
false));
85 $process->expects($this->once())
86 ->method(
'getWorkingDirectory')
87 ->will($this->returnValue($workingDirectory));
92 "The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}\n\nOutput:\n================\n{$output}\n\nError Output:\n================\n{$errorOutput}",
93 $exception->getMessage()
105 $exitText =
'General error';
106 $workingDirectory = getcwd();
108 $process = $this->getMock(
109 'Symfony\Component\Process\Process',
110 array(
'isSuccessful',
'isOutputDisabled',
'getExitCode',
'getExitCodeText',
'getOutput',
'getErrorOutput',
'getWorkingDirectory'),
113 $process->expects($this->once())
114 ->method(
'isSuccessful')
115 ->will($this->returnValue(
false));
117 $process->expects($this->never())
118 ->method(
'getOutput');
120 $process->expects($this->never())
121 ->method(
'getErrorOutput');
123 $process->expects($this->once())
124 ->method(
'getExitCode')
125 ->will($this->returnValue($exitCode));
127 $process->expects($this->once())
128 ->method(
'getExitCodeText')
129 ->will($this->returnValue($exitText));
131 $process->expects($this->once())
132 ->method(
'isOutputDisabled')
133 ->will($this->returnValue(
true));
135 $process->expects($this->once())
136 ->method(
'getWorkingDirectory')
137 ->will($this->returnValue($workingDirectory));
142 "The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}",
143 $exception->getMessage()
testProcessFailedExceptionPopulatesInformationFromProcessOutput()
tests ProcessFailedException uses information from process output to generate exception message...
testProcessFailedExceptionThrowsException()
tests ProcessFailedException throws exception if the process was successful.
testDisabledOutputInFailedExceptionDoesNotPopulateOutput()
Tests that ProcessFailedException does not extract information from process output if it was previous...
Exception for failed processes.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
Create styles array
The data for the language used.