/** * @test */ public function forgetCommand() { $forgetCmd = Factory::createForget(); $forgetCmd->addFile('C:\\xampp\\file1\\'); $forgetCmd->addFile('C:\\xampp\\file2\\'); $forgetCmd->addInclude('includePattern'); $forgetCmd->addExclude('excludePattern'); $file = '\'C:\\xampp\\file1\\\' \'C:\\xampp\\file2\\\''; $expected = 'hg forget --include includePattern --exclude excludePattern '; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $file = str_replace("'", '"', $file); } $this->assertSame($file, implode(' ', $forgetCmd->getFile())); $this->assertSame($expected . $file, $forgetCmd->asString()); }