/**
  * Test that the spawner really spawns the process correctly.
  *
  * @return void
  */
 public function testRun()
 {
     $config = new TensideJsonConfig(new JsonArray());
     $config->setPhpCliArguments(['-dmemory_limit=1G']);
     $config->setPhpCliEnvironment(['TESTVAR=TESTVALUE']);
     $process = PhpProcessSpawner::create($config, $this->getTempDir())->spawn(['-r', 'echo getenv(\'TESTVAR\') . ini_get(\'memory_limit\');']);
     $process->run();
     $cli = $process->getCommandLine();
     $this->assertEquals('php \'-dmemory_limit=1G\' ' . '\'-r\' \'echo getenv(\'\\\'\'TESTVAR\'\\\'\') . ini_get(\'\\\'\'memory_limit\'\\\'\');\'', $cli);
     $this->assertEquals(0, $process->getExitCode());
     $this->assertEquals('TESTVALUE1G', $process->getOutput());
     $this->assertEquals('', $process->getErrorOutput());
 }