function it_throws_an_exception_when_requesting_an_icon_for_an_unknown_model(Model $model) { $this->configureClubConfigStubs(); $this->configure(['spec\\Label305\\AujaLaravel\\Config\\Club']); $model->getName()->willReturn('House'); $this->shouldThrow('\\LogicException')->during('getIcon', [$model]); }
/** * Resolves the fields to display in a Form. * * @return String[] The names of the fields to display. */ private function resolveVisibleFields() { $result = []; $columns = $this->model->getColumns(); foreach ($columns as $column) { $result[] = $column->getName(); } return $result; }
/** * Defines a many-to-many relation between given models. * * @param $model1 Model the first model. * @param $model2 Model the second model. */ private function defineManyToManyRelation(Model $model1, Model $model2) { //$this->app['log']->info(sprintf('%s has and belongs to many %s', $model1->getName(), str_plural($model2->getName()))); $this->relations[$model1->getName()][] = new Relation($model1, $model2, Relation::HAS_AND_BELONGS_TO); $this->relations[$model2->getName()][] = new Relation($model2, $model1, Relation::HAS_AND_BELONGS_TO); }