public function testCommandOnlyArgvSetMerge() { //Argv with pass through arguments $argv = ['/Users/tom/Sites/_MyCode/PHP/twRobo/src/tg', 'phpunit:watch']; $merger = new Merger(); $merger->setArgs($argv, $this->configfile); $merged = $merger->merge(); $this->assertCount(5, $merged); $this->assertEquals("/config/file/path", $merged[2]); $this->assertEquals("--", $merged[3]); $this->assertEquals("--configuration=phpunit.xml.dev", $merged[4]); }
/** * @param $argv * @return array */ protected function mergeArgv($argv) { //Merge our args with our config file if (class_exists('TgCommands')) { $fileName = TgCommands::TGCONFIG . '.yml'; if (file_exists($fileName)) { $configFile = Yaml::parse(file_get_contents($fileName)); $merger = new Merger(); $merger->setArgs($argv, $configFile); $argv = $merger->merge(); } } return $argv; }