-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from CamiloManrique/29-easier-stderr
Add command error output to stderr
- Loading branch information
Showing
3 changed files
with
66 additions
and
14 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
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
33 changes: 33 additions & 0 deletions
33
tests/Alchemy/Tests/BinaryDriver/Exceptions/ExecutionFailureExceptionTest.php
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Alchemy\Tests\BinaryDriver\Exceptions; | ||
|
||
use Alchemy\BinaryDriver\BinaryDriverTestCase; | ||
use Alchemy\BinaryDriver\Exception\ExecutionFailureException; | ||
use Alchemy\BinaryDriver\ProcessRunner; | ||
|
||
class ExecutionFailureExceptionTest extends BinaryDriverTestCase | ||
{ | ||
public function getProcessRunner($logger) | ||
{ | ||
return new ProcessRunner($logger, 'test-runner'); | ||
} | ||
|
||
public function testGetExceptionInfo(){ | ||
|
||
$logger = $this->createLoggerMock(); | ||
$runner = $this->getProcessRunner($logger); | ||
|
||
$process = $this->createProcessMock(1, false, '--helloworld--', null, "Error Output", true); | ||
try{ | ||
$runner->run($process, new \SplObjectStorage(), false); | ||
$this->fail('An exception should have been raised'); | ||
} | ||
catch (ExecutionFailureException $e){ | ||
$this->assertEquals("--helloworld--", $e->getCommand()); | ||
$this->assertEquals("Error Output", $e->getErrorOutput()); | ||
} | ||
|
||
} | ||
|
||
} |
ae5abc1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix! Please ad some tags for this (5.0.1 example) - this commit very useful!
ae5abc1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder (and sorry my late response)! 5.1.0 is out!