/** * @test */ public function archiveCommand() { $archiveCmd = Factory::createArchive(); $archiveCmd->setDestination('C:\\xampp\\dest\\'); $archiveCmd->addInclude('includePattern'); $archiveCmd->addExclude('excludePattern'); $archiveCmd->setSubrepos(true); $archiveCmd->setNoDecode(true); $destination = '\'C:\\xampp\\dest\\\''; $expected = 'hg archive --no-decode --subrepos --include includePattern --exclude excludePattern '; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $destination = str_replace("'", '"', $destination); } $this->assertSame($destination, $archiveCmd->getDestination()); $this->assertSame($expected . $destination, $archiveCmd->asString()); }