Example #1
0
 public function testSetType()
 {
     $xml = new \XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString("\t");
     $node = new Relation();
     $this->setExpectedException('InvalidArgumentException');
     $node->setType('Foo');
 }
 /**
  * @depends testRelationshipFeed
  */
 public function testAddRelationship()
 {
     $client = $this->getServiceBuilder()->get('test.mws');
     $feed = $client->getFeed('relationship');
     $relationship = new Relationship($feed->getXml());
     $relationship->setParentSku('ASDF');
     $relationship->addRelation(DataType\Relation::factory('ASDF_M', 'Variation'));
     $feed->addRelationship($relationship);
     $dom = new \DOMDocument();
     $dom->loadXML($feed->toString());
     $this->assertSelectEquals('AmazonEnvelope Message MessageID', '1', true, $dom, null, false);
     $this->assertSelectEquals('AmazonEnvelope Message OperationType', 'Update', true, $dom, null, false);
     $this->assertSelectCount('AmazonEnvelope Message Relationship', 1, $dom, null, false);
 }