/**
  * @param DataStorageItem $storageItem
  *
  * @dataProvider dataProvider
  */
 public function testXMLGeneration($storageItem)
 {
     $prophet = new Prophet();
     $orderService = $prophet->prophesize('Checkdomain\\TeleCash\\IPG\\API\\Service\\OrderService');
     $display = new DisplayHostedData($orderService->reveal(), $storageItem);
     $document = $display->getDocument();
     $document->appendChild($display->getElement());
     $elementStore = $document->getElementsByTagName('ns2:StoreHostedData');
     $this->assertEquals(1, $elementStore->length, 'Expected element StoreHostedData not found');
     $children = [];
     /** @var \DOMNode $child */
     foreach ($elementStore->item(0)->childNodes as $child) {
         $children[$child->nodeName] = $child->nodeValue;
     }
     $this->assertArrayHasKey('ns2:DataStorageItem', $children, 'Expected element DataStorageItem not found');
     //no need to further test DataStorageItem, as this is already covered in DataStorageItemTest
 }
Beispiel #2
0
 /**
  * Display externally stored data
  *
  * @param string $hostedDataId
  *
  * @return Response\Action\Display|Response\Error
  * @throws \Exception
  */
 public function displayHostedData($hostedDataId)
 {
     $service = $this->getService();
     $storageItem = new Model\DataStorageItem($hostedDataId);
     $displayAction = new Request\Action\DisplayHostedData($service, $storageItem);
     return $displayAction->display();
 }