コード例 #1
0
 /**
  * @test
  */
 public function parentsCommand()
 {
     $parentsCmd = Factory::createParents();
     $parentsCmd->setFile('C:\\xampp\\file\\');
     $parentsCmd->setRev('revision');
     $parentsCmd->setTemplate('template');
     $file = '\'C:\\xampp\\file\\\'';
     $expected = 'hg parents --rev ' . escapeshellarg('revision') . ' --template ' . escapeshellarg('template') . ' ';
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         $file = str_replace("'", '"', $file);
     }
     $this->assertSame($file, $parentsCmd->getFile());
     $this->assertSame($expected . $file, $parentsCmd->asString());
 }