public function testMergeAttributes() { $blueprint = new Blueprint('foo'); $attributes1 = array('foo'); $attributes2 = array('bar'); $blueprint->mergeAttributes($attributes1); $blueprint->mergeAttributes($attributes2); $this->assertEquals($blueprint->getAttributes(), array('foo', 'bar')); }
/** * Create a fake model instance from Blueprint * * @param Skovachev\Fakefactory\Model\Blueprint\Blueprint $blueprint * @return object */ protected function makeFromBlueprint($blueprint) { $modelClass = $blueprint->getClass(); $model = $this->reflector->instantiate($modelClass); foreach ($blueprint->getAttributes() as $attribute) { $this->model->setAttribute($model, $attribute); } foreach ($blueprint->getRelations() as $relation) { $relation->applyToModelAndContainedValue($model); $this->model->setRelation($model, $relation); } $this->clearBuildOptions(); return $model; }