public function testSerializeResourceToStringWithN3() { $this->markTestNeedsDatabase(); $this->authenticateDbUser(); $g = 'http://localhost/OntoWiki/Config/'; $this->_object->initializeWithFormat('ttl'); $result1 = $this->_object->serializeResourceToString($g, $g); require_once 'Erfurt/Syntax/RdfSerializer/Adapter/Turtle.php'; $adapter = new Erfurt_Syntax_RdfSerializer_Adapter_Turtle(); $result2 = $adapter->serializeResourceToString($g, $g); $this->assertEquals($result1, $result2); }
/** * @medium **/ public function testParseWithUrlAndRdfXml302After303GithubOntoWikiIssue101() { $this->_object->initializeWithFormat('rdfxml'); $adapter = new Zend_Http_Client_Adapter_Test(); $this->_object->setHttpClientAdapter($adapter); $adapter->setResponse(new Zend_Http_Response(302, array('Content-Type' => 'text/html; charset=iso-8859-1', 'Location' => 'http://motools.sourceforge.net/mo/'))); $adapter->addResponse(new Zend_Http_Response(303, array('Content-Type' => 'text/html; charset=iso-8859-1', 'Location' => 'http://motools.sourceforge.net/doc/musicontology.rdfs'))); $adapter->addResponse(new Zend_Http_Response(200, array('Content-Type' => 'application/rdf+xml'), file_get_contents($this->_resourcesDirectory . 'valid/musicontology.rdfs'))); $result = $this->_object->parse('http://purl.org/ontology/mo/', Erfurt_Syntax_RdfParser::LOCATOR_URL); $this->assertInternalType('array', $result); }