Lines Matching refs:p
91 $p = $this->getProcess('');
92 $p->setTimeout(-1);
97 $p = $this->getProcess('');
99 $p->setTimeout(10);
100 $this->assertSame(10.0, $p->getTimeout());
102 $p->setTimeout(null);
103 $this->assertNull($p->getTimeout());
105 $p->setTimeout(0.0);
106 $this->assertNull($p->getTimeout());
114 $p = $this->getProcess([self::$phpBin, __DIR__.'/NonStopableProcess.php', 30]);
115 $p->start();
117 while (false === strpos($p->getOutput(), 'received')) {
121 $p->stop(0.1);
123 $p->wait();
140 $p = $this->getProcessForCode($code);
142 $p->start();
145 $h = new \ReflectionProperty($p, 'process');
147 $h = $h->getValue($p);
155 $o = $p->getOutput();
179 $p = $this->getProcessForCode($code);
180 $p->run();
182 $this->assertSame($expected, $p->$getter());
195 $p = $this->getProcessForCode($code);
196 $p->setInput($expected);
197 $p->run();
199 $this->assertEquals($expectedLength, \strlen($p->getOutput()));
200 $this->assertEquals($expectedLength, \strlen($p->getErrorOutput()));
215 $p = $this->getProcessForCode($code);
216 $p->setInput($stream);
217 $p->run();
221 $this->assertEquals($expectedLength, \strlen($p->getOutput()));
222 $this->assertEquals($expectedLength, \strlen($p->getErrorOutput()));
231 $p = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);');
232 $p->setInput($stream);
233 $p->start(function ($type, $data) use ($stream) {
238 $p->wait();
240 $this->assertSame('hello', $p->getOutput());
324 $p = $this->getProcessForCode('echo \'foo\';');
327 $p->run(function ($type, $buffer) use (&$called) {
336 $p = $this->getProcessForCode('echo \'foo\';');
337 $p->disableOutput();
340 $p->run(function ($type, $buffer) use (&$called) {
349 …$p = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERRO…
351 $p->run();
352 $this->assertEquals(3, preg_match_all('/ERROR/', $p->getErrorOutput(), $matches));
357 …$p = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERRO…
359 $p->run();
360 $p->clearErrorOutput();
361 $this->assertEmpty($p->getErrorOutput());
371 …$p = $this->getProcessForCode('file_put_contents($s = \''.$uri.'\', \'foo\'); flock(fopen('.var_ex…
376 $p->start();
379 while (false === strpos($p->$getOutput(), $s)) {
383 $this->assertSame($s, $p->$getIncrementalOutput());
384 $this->assertSame('', $p->$getIncrementalOutput());
402 $p = $this->getProcessForCode('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }');
404 $p->run();
405 $this->assertEquals(3, preg_match_all('/foo/', $p->getOutput(), $matches));
410 $p = $this->getProcessForCode('$n=0;while ($n<3) {echo \' foo \';$n++;}');
412 $p->run();
413 $p->clearOutput();
414 $this->assertEmpty($p->getOutput());
421 $p = $this->getProcess('echo | set /p dummyName=0');
423 $p = $this->getProcess('printf 0');
426 $p->run();
427 $this->assertSame('0', $p->getOutput());
541 $p = $r->getProperty('exitcode');
542 $p->setAccessible(true);
544 $p->setValue($process, 2);
1024 $p = $this->getProcess('foo');
1025 $this->assertFalse($p->isOutputDisabled());
1026 $p->disableOutput();
1027 $this->assertTrue($p->isOutputDisabled());
1028 $p->enableOutput();
1029 $this->assertFalse($p->isOutputDisabled());
1036 $p = $this->getProcessForCode('sleep(39);');
1037 $p->start();
1038 $p->disableOutput();
1045 $p = $this->getProcessForCode('sleep(40);');
1046 $p->disableOutput();
1047 $p->start();
1048 $p->enableOutput();
1053 $p = $this->getProcess('echo foo');
1054 $p->disableOutput();
1055 $p->run();
1056 $p->enableOutput();
1057 $p->disableOutput();
1058 $this->assertTrue($p->isOutputDisabled());
1093 $p = $this->getProcessForCode('sleep(41);');
1094 $p->disableOutput();
1095 $p->start();
1096 $p->{$fetchMethod}();
1456 $p = new Process(['/usr/bin/php']);
1459 $this->assertSame($expected, $p->getCommandLine());
1467 $p = new Process([self::$phpBin, '-r', 'echo $argv[1];', $arg]);
1468 $p->run();
1470 $this->assertSame((string) $arg, $p->getOutput());
1479 $p = new Process([self::$phpBin, '-r', 'echo $argv[1];', $arg], null, ['BAR' => 'BAZ']);
1480 $p->inheritEnvironmentVariables(false);
1481 $p->run();
1483 $this->assertSame((string) $arg, $p->getOutput());
1488 …$p = new Process(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);')…
1489 $p->run();
1501 $this->assertSame($expected, str_replace('Standard input code', '-', $p->getOutput()));
1522 $p = new Process($cmd, null, $env);
1523 $p->run(null, ['BAR' => 'baR', 'BAZ' => 'baZ']);
1525 $this->assertSame('Foo baR baZ', rtrim($p->getOutput()));
1526 $this->assertSame($env, $p->getEnv());