public function testFromArrayWithReplace() { $properties = array('foo' => 'bar'); $newProperties = array('foo2' => 'bar2'); $this->entity->fromArray($properties); $this->assertSame($properties, $this->entity->toArray()); $this->entity->fromArray($newProperties, true); $this->assertSame($newProperties, $this->entity->toArray()); }
public function fromArray(array $properties, $replace = false) { if (isset($properties[self::AUTHENTICATION_INFO]) && is_array($properties[self::AUTHENTICATION_INFO])) { $authenticationInfo = new AuthenticationInfo(); $authenticationInfo->fromArray($properties[self::AUTHENTICATION_INFO]); $this->setAuthenticationInfo($authenticationInfo); unset($properties[self::AUTHENTICATION_INFO]); } parent::fromArray($properties); }