示例#1
0
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->originalEvent->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->originalEvent->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->originalEvent->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->originalEvent->extensionAttributes['foo2']['value']);
     $originalEventXml = $this->originalEvent->saveXML();
     $newOriginalEvent = new Extension\OriginalEvent();
     $newOriginalEvent->transferFromXML($originalEventXml);
     $this->assertEquals('bar', $newOriginalEvent->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newOriginalEvent->extensionAttributes['foo2']['value']);
 }