Example #1
0
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->category->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->category->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->category->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->category->extensionAttributes['foo2']['value']);
     $categoryXml = $this->category->saveXML();
     $newCategory = new Extension\Category();
     $newCategory->transferFromXML($categoryXml);
     $this->assertEquals('bar', $newCategory->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newCategory->extensionAttributes['foo2']['value']);
 }