コード例 #1
0
 /**
  * @test
  */
 public function removeCommand()
 {
     $removeCmd = Factory::createRemove();
     $removeCmd->addFile('C:\\xampp\\file1\\');
     $removeCmd->addFile('C:\\xampp\\file2\\');
     $removeCmd->setAfter(true);
     $removeCmd->addInclude('includePattern');
     $removeCmd->addExclude('excludePattern');
     $removeCmd->setForce(true);
     $file = '\'C:\\xampp\\file1\\\' \'C:\\xampp\\file2\\\'';
     $expected = 'hg remove --after --force --include includePattern --exclude excludePattern ';
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         $file = str_replace("'", '"', $file);
     }
     $this->assertSame($file, implode(' ', $removeCmd->getFile()));
     $this->assertSame($expected . $file, $removeCmd->asString());
 }