/** * @return $this * @throws \Bluzman\Input\InputException */ protected function cloneProject() { $name = $this->getOption('name'); $path = $this->getOption('path'); $this->getOutput()->writeln('Cloning skeleton project...'); chdir($path); $projectPath = realpath($path) . DS . $name; if (is_dir($projectPath)) { $validator = new DirectoryEmpty(); if (!$validator->validate($projectPath)) { throw new Input\InputException('"' . $projectPath . '" must be empty.'); } } //@todo Use symfony process // create skeleton project $process = new Process(sprintf($this->getCmdPattern(), $name)); $process->setTimeout(1600); $process->run(); chdir($projectPath); return $this; }
/** * @expectedException \Bluzman\Validation\Exceptions\DirectoryEmptyException */ public function testNotEmptyDirectory() { $v = new DirectoryEmpty(); $v->check($this->notEmptyDir); }