/** * @test */ public function statusCommand() { $statusCmd = Factory::createStatus(); $statusCmd->addFile('C:\\xampp\\file\\'); $statusCmd->addInclude('includePattern'); $statusCmd->addExclude('excludePattern'); $statusCmd->setSubrepos(true); $file = '\'C:\\xampp\\file\\\''; $expected = 'hg status --include includePattern --exclude excludePattern --subrepos '; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $file = str_replace("'", '"', $file); } $this->assertSame($file, implode(' ', $statusCmd->getFile())); $this->assertSame($expected . $file, $statusCmd->asString()); }
/** * @test * * @expectedException \RuntimeException */ public function executeCommandWithoutRepositoryInitilized() { Factory::createStatus()->execute(); }