public function test1() { $php2xml = new xsd2php\Php2Xml(); $xml = $php2xml->getXml($this->oecd); $expFn = __DIR__ . "/expected1.xml"; //file_put_contents($expFn,$xml); //var_dump($xml); $this->assertEquals($xml, file_get_contents($expFn)); }
public function testContactCompany() { $cc = new CCP\ContactCompany(); $bilAd = new CCP\AddressType(); $addLine = new CAC2\AddressLine(); $line = new CBC2\Line(); $line->value = "Address line"; $addLine->Line = $line; $bilAd->Address = $addLine; $bilAd->City = "Aalborg"; $bilAd->Country = "DK"; $bilAd->PostalCode = "9200"; $cc->BillingAddress = $bilAd; $cId = new CBC2\CompanyID(); $cId->value = "23423423423"; $cc->CompanyID = $cId; $id = new CBC2\ID(); $id->value = "3242342323"; $cc->ID = $id; $ships = array(); $ship1 = new CCP\AddressType(); $addLine1 = new CAC2\AddressLine(); $sLine = new CBC2\Line(); $sLine->value = "Gammelnibevej 122"; $addLine1->Line = $sLine; $ship1->Address = $addLine1; array_push($ships, $ship1); $ship2 = new CCP\AddressType(); $addLine2 = new CAC2\AddressLine(); $sLine2 = new CBC2\Line(); $sLine2->value = "Nyborgvej 23 st th"; $addLine2->Line = $sLine2; $ship2->Address = $addLine2; array_push($ships, $ship2); $cc->ShippingAddress = $ships; $php2xml = new xsd2php\Php2Xml(); $xml = $php2xml->getXml($cc); //print_r($xml); //file_put_contents("data/expected/ContactCompany/ContactCompany.xml", $xml); $expected = file_get_contents("data/expected/ContactCompany/ContactCompany.xml"); $this->assertEquals($expected, $xml); }