<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Process\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Process\Process; /** * @author Andrei Olteanu <andrei@flashsoft.eu> */ class CreateNewConsoleTest extends TestCase { public function testOptionCreateNewConsole() { $this->expectNotToPerformAssertions(); try { $process = new Process(['php', __DIR__.'/ThreeSecondProcess.php']); $process->setOptions(['create_new_console' => true]); $process->disableOutput(); $process->start(); } catch (\Exception $e) { $this->fail($e); } } public function testItReturnsFastAfterStart() { // The started process must run in background after the main has finished but that can't be tested with PHPUnit $startTime = microtime(true); $process = new Process(['php', __DIR__.'/ThreeSecondProcess.php']); $process->setOptions(['create_new_console' => true]); $process->disableOutput(); $process->start(); $this->assertLessThan(3000, $startTime - microtime(true)); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
CreateNewConsoleTest.php | File | 1.37 KB | 0644 |
|
ErrorProcessInitiator.php | File | 955 B | 0644 |
|
ExecutableFinderTest.php | File | 4.77 KB | 0644 |
|
KillableProcessWithOutput.php | File | 537 B | 0644 |
|
NonStopableProcess.php | File | 993 B | 0644 |
|
PhpExecutableFinderTest.php | File | 2.6 KB | 0644 |
|
PhpProcessTest.php | File | 2.28 KB | 0644 |
|
PipeStdinInStdoutStdErrStreamSelect.php | File | 1.77 KB | 0644 |
|
ProcessFailedExceptionTest.php | File | 4.69 KB | 0644 |
|
ProcessTest.php | File | 49.27 KB | 0644 |
|
SignalListener.php | File | 420 B | 0644 |
|
ThreeSecondProcess.php | File | 305 B | 0644 |
|