-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 4.4: Use createMock() and use import instead of FQCN
- Loading branch information
Showing
2 changed files
with
14 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Process\Exception\ProcessFailedException; | ||
use Symfony\Component\Process\Process; | ||
|
||
/** | ||
* @author Sebastian Marek <[email protected]> | ||
|
@@ -24,7 +25,7 @@ class ProcessFailedExceptionTest extends TestCase | |
*/ | ||
public function testProcessFailedExceptionThrowsException() | ||
{ | ||
$process = $this->getMockBuilder(\Symfony\Component\Process\Process::class)->setMethods(['isSuccessful'])->setConstructorArgs([['php']])->getMock(); | ||
$process = $this->getMockBuilder(Process::class)->setMethods(['isSuccessful'])->setConstructorArgs([['php']])->getMock(); | ||
$process->expects($this->once()) | ||
->method('isSuccessful') | ||
->willReturn(true); | ||
|
@@ -48,7 +49,7 @@ public function testProcessFailedExceptionPopulatesInformationFromProcessOutput( | |
$errorOutput = 'FATAL: Unexpected error'; | ||
$workingDirectory = getcwd(); | ||
|
||
$process = $this->getMockBuilder(\Symfony\Component\Process\Process::class)->setMethods(['isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled', 'getWorkingDirectory'])->setConstructorArgs([[$cmd]])->getMock(); | ||
$process = $this->getMockBuilder(Process::class)->setMethods(['isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled', 'getWorkingDirectory'])->setConstructorArgs([[$cmd]])->getMock(); | ||
$process->expects($this->once()) | ||
->method('isSuccessful') | ||
->willReturn(false); | ||
|
@@ -96,7 +97,7 @@ public function testDisabledOutputInFailedExceptionDoesNotPopulateOutput() | |
$exitText = 'General error'; | ||
$workingDirectory = getcwd(); | ||
|
||
$process = $this->getMockBuilder(\Symfony\Component\Process\Process::class)->setMethods(['isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput', 'getWorkingDirectory'])->setConstructorArgs([[$cmd]])->getMock(); | ||
$process = $this->getMockBuilder(Process::class)->setMethods(['isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput', 'getWorkingDirectory'])->setConstructorArgs([[$cmd]])->getMock(); | ||
$process->expects($this->once()) | ||
->method('isSuccessful') | ||
->willReturn(false); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters