Esempio n. 1
0
 /**
  * Test that the spawner spawns the process in background.
  *
  * @return void
  */
 public function testRunBackground()
 {
     $config = new TensideJsonConfig(new JsonArray());
     $config->setForceToBackground(true);
     $process = PhpProcessSpawner::create($config, $this->getTempDir())->spawn(['--version']);
     $cli = $process->getCommandLine();
     if ('\\' === DIRECTORY_SEPARATOR) {
         $this->assertEquals('start /B ' . escapeshellarg('php') . ' ' . escapeshellarg('--version'), $cli);
     } else {
         $this->assertEquals(escapeshellarg('php') . ' ' . escapeshellarg('--version') . ' &', $cli);
     }
 }