/** * @param DataStorageItem $storageItem * * @dataProvider dataProvider */ public function testXMLGeneration($storageItem) { $prophet = new Prophet(); $orderService = $prophet->prophesize('Checkdomain\\TeleCash\\IPG\\API\\Service\\OrderService'); $delete = new DeleteHostedData($orderService->reveal(), $storageItem); $document = $delete->getDocument(); $document->appendChild($delete->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 }
/** * Delete externally store data * * @param string $hostedDataId * * @return Response\Action\Confirm|Response\Error * @throws \Exception */ public function deleteHostedData($hostedDataId) { $service = $this->getService(); $storageItem = new Model\DataStorageItem($hostedDataId); $deleteAction = new Request\Action\DeleteHostedData($service, $storageItem); return $deleteAction->delete(); }