/** * @expectedException \Pangaea\PangaeaException * @expectedExceptionRegExp /xmlParseEntityRef: no name/ */ public function testValidateInvalidXml() { $xmlPath = __DIR__ . '/fixtures/invalid_items.xml'; $schemaPath = __DIR__ . '/../xsd/feed/Feed.xsd'; $this->assertFalse(Xml::validate($xmlPath, $schemaPath)); }
/** * Validates the document and saves to the specified path * * @param $path * @return boolean * @throws \PangaeaException */ public function save($path) { $result = file_put_contents($path, $this->render()); Xml::validate($path, __DIR__ . '/../xsd/feed/Feed.xsd'); return $result > 0; }