symfony/symfony — pull request #9452 by max-voloshin (2013-11-05 22:36:03+00:00)
Title: [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |

Added logic exceptions for prevent fatal errors in ``getOutput`` and ``getErrorOutput`` when process was not started.

```
Fatal error: Call to a member function readAndCloseHandles() on a non-object in /home/max/symfony/src/Symfony/Component/Process/Process.php on line 1117

Call Stack:
0.0002 231816 1. {main}() /home/max/phpunit/composer/bin/phpunit:0
0.0038 526688 2. PHPUnit_TextUI_Command::main() /home/max/phpunit/composer/bin/phpunit:63
0.0038 526912 3. PHPUnit_TextUI_Command->run() /home/max/phpunit/PHPUnit/TextUI/Command.php:126
0.2261 4022696 4. PHPUnit_TextUI_TestRunner->doRun() /home/max/phpunit/PHPUnit/TextUI/Command.php:173
0.2302 4353544 5. PHPUnit_Framework_TestSuite->run() /home/max/phpunit/PHPUnit/TextUI/TestRunner.php:415
0.3218 5675504 6. PHPUnit_Framework_TestSuite->run() /home/max/phpunit/PHPUnit/Framework/TestSuite.php:729
15.1171 38257632 7. PHPUnit_Framework_TestCase->run() /home/max/phpunit/PHPUnit/Framework/TestSuite.php:729
15.1172 38257632 8. PHPUnit_Framework_TestResult->run() /home/max/phpunit/PHPUnit/Framework/TestCase.php:782
15.1173 38258544 9. PHPUnit_Framework_TestCase->runBare() /home/max/phpunit/PHPUnit/Framework/TestResult.php:661
15.1174 38275544 10. PHPUnit_Framework_TestCase->runTest() /home/max/phpunit/PHPUnit/Framework/TestCase.php:839
15.1175 38276408 11. ReflectionMethod->invokeArgs() /home/max/phpunit/PHPUnit/Framework/TestCase.php:987
15.1175 38276440 12. Symfony\Component\Process\Tests\AbstractProcessTest->testGetOutputProcessNotRunning() /home/max/phpunit/PHPUnit/Framework/TestCase.php:987
15.1175 38277728 13. Symfony\Component\Process\Process->getOutput() /home/max/symfony/src/Symfony/Component/Process/Tests/AbstractProcessTest.php:636
15.1175 38277824 14. Symfony\Component\Process\Process->readPipes() /home/max/symfony/src/Symfony/Component/Process/Process.php:383
```