/** * @param Payment $payment * * @dataProvider dataProvider */ public function testXMLGeneration($payment) { $prophet = new Prophet(); $orderService = $prophet->prophesize('Checkdomain\\TeleCash\\IPG\\API\\Service\\OrderService'); $validate = new ValidateHostedData($orderService->reveal(), $payment); $document = $validate->getDocument(); $document->appendChild($validate->getElement()); $elementValidate = $document->getElementsByTagName('ns2:Validate'); $this->assertEquals(1, $elementValidate->length, 'Expected element Validate not found'); $children = []; /** @var \DOMNode $child */ foreach ($elementValidate->item(0)->childNodes as $child) { $children[$child->nodeName] = $child->nodeValue; } $this->assertArrayHasKey('ns1:Payment', $children, 'Expected element Payment not found'); //no need to further test Payment, as this is already covered in PaymentTest }