/** * create object from array * @see parent::fromArray * @param array $array */ public function fromArray($array) { if (!empty($array['number'])) { $this->_ensureNumber()->fromArray($array['number']); unset($array['number']); } if (!empty($array['map_data'])) { $this->setMapData(Mapping::create($array['map_data'])); unset($array['map_data']); } parent::fromArray($array); }
/** @test */ public function it_tests_a_convenience_constructor_of_a_collaborator() { $client = new ClientObject("Client Name", new Assignment(ModelA::class, ProductA::class), new Assignment(ModelB::class, PartB::class)); $test = new TestIdentity(); $this->assertTrue($client->unamedProductA()->identification()['number'] == $test->id()); }