/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Process/Tests/CreateNewConsoleTest.php
45 строк
1 KB
Andrei O
[Process] allow setting options esp. "create_new_console" to detach a subprocess
08 сен 2020, 15:47
08 сен 2020, 15:47
e9ab235
Код
Авторство
О чём код?
<?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)); } }