public function testFailPaths() { $this->prepareInput(); $model = new PublishModel($this->inputMock); $this->assertSame('*', $model->getPackageEntry()); $this->assertSame('*', $model->getGroupEntry()); $this->assertSame(getcwd(), $model->getConfigPath()); $this->assertSame(getcwd(), $model->getPublishPath()); }
/** * @param Models\PublishModel $model * @return PublisherHandler * @throws \Exception */ public function setModel(Models\PublishModel $model) { $this->model = $model; // checking if vendor folder is available // if not - throwing an exception if (!($this->vendorPath = realpath($model->getConfigPath() . '/vendor'))) { throw new \Exception("Unable to locate \"vendor\" folder. Try to run \"composer update\""); } if ($model->getPackageEntry() == '*') { $this->packageList = $this->handler->getPackageNames(); } else { // if package name is specified // adding it into package list $this->packageList = explode(',', $model->getPackageEntry()); } if (($this->groupList = $model->getGroupEntry()) != '*') { $this->groupList = explode(',', $model->getGroupEntry()); } $this->groupList = (array) $this->groupList; return $this; }