public function testSavePHPBindings() { if (file_exists($this->generatedDir . "/bindings")) { rmdir_recursive($this->generatedDir . "/bindings"); } //$this->tclass->saveClasses($this->expectedDir."/bindings", true); $this->tclass->saveClasses($this->generatedDir . "/bindings", true); $this->assertDirContentsEquals($this->expectedDir . "/bindings", $this->generatedDir . "/bindings"); if (file_exists($this->generatedDir . "/bindings")) { rmdir_recursive($this->generatedDir . "/bindings"); } }
public function testContactCompany() { $expPath = dirname(__FILE__) . '/data/expected/ContactCompany/'; $genPath = dirname(__FILE__) . '/data/generated/ContactCompany/'; $this->tclass = new xsd2php\Xsd2Php("../resources/ContactCompany/ContactCompany.xsd"); $xml = $this->tclass->getXML(); //file_put_contents($expPath.'generated.xml', $xml->saveXml()); $expectedXml = file_get_contents($expPath . 'generated.xml'); $this->assertEquals($expectedXml, $xml->saveXml()); if (file_exists($genPath)) { rmdir_recursive(realpath($genPath)); } $this->tclass->saveClasses($genPath, true); //$cp = new ContactCompany\ContactCompany(); //$id = new CommonBasicComponents_2\ID(); if (file_exists($genPath)) { rmdir_recursive(realpath($genPath)); } }
public function compileSchema($schema, $destination) { $this->xsd2php = new Xsd2Php($schema); $this->xsd2php->saveClasses($destination, true); }