public function testCreateDocumentFromErrneousDocbook() { $doc = new ezcDocumentDocbook(); $doc->options->failOnError = false; $doc->loadFile(dirname(__FILE__) . '/files/docbook/errorneous.xml'); $rst = new ezcDocumentRst(); try { $rst->createFromDocbook($doc); $this->fail('Expected ezcDocumentVisitException.'); } catch (ezcDocumentVisitException $e) { /* Expected */ } }
<?php require 'tutorial_autoload.php'; $docbook = new ezcDocumentDocbook(); $docbook->loadFile('docbook.xml'); $rst = new ezcDocumentRst(); $rst->createFromDocbook($docbook); echo $rst->save();