/** * allow to create object with given xml data * * @param mixed $first * @param mixed $second * * @dataProvider baseDataProvider * @requires baseDataProvider * @requires _exampleStdData */ public function testCreationWithSimpleXml($first, $second) { $xml = $this->_exampleSimpleXmlData($first, $second); $object = new Object(['type' => 'simple_xml', 'data' => $xml]); $this->assertXmlStringEqualsXmlString($this->_exampleSimpleXmlData($first, $second), $object->toXml()); $this->assertXmlStringEqualsXmlString($this->_exampleSimpleXmlData($first, $second), $object->toXml(false)); $this->assertEquals($this->_convertType($first), $object->getDataFirst()); $this->assertEquals($this->_convertType($second), $object->toArray('data_second')); }
/** * allow to join two blue objects into one * * @param \ClassKernel\Data\Object $object * @return $this */ public function mergeBlueObject(Object $object) { $newData = $object->toArray(); foreach ($newData as $key => $value) { $this->appendData($key, $value); } $this->_dataChanged = true; return $this; }