private function selfInit(InputArgs $inputArgs) { $arguments = $inputArgs->getArguments(); if (isset($arguments[0]) && $arguments[0] === 'self-init') { $directoryName = isset($arguments[1]) ? $arguments[1] : 'build'; $selfInit = new Commands\SelfInit(); $selfInit->setDistDirectory(__DIR__ . '/build-dist'); $selfInit->setWorkingDirectory($this->workingDir); $selfInit->setDirname($directoryName); $selfInit->execute(); $this->terminate(0); } }
/** * @expectedException \Genesis\ErrorException * @expectedExceptionMessageRegExp /Directory 'build-dist' in working directory '.+' already exists\./ */ public function testSelfInitError() { $distDirectory = __DIR__ . '/../src/build-dist'; $workingDirectory = __DIR__ . '/../src'; $selfInit = new Commands\SelfInit(); $selfInit->setDistDirectory($distDirectory); $selfInit->setWorkingDirectory($workingDirectory); $selfInit->setDirname('build-dist'); $selfInit->execute(); }