function setUp() { $this->mockRequest = $this->getMockRequest(); $config = new ConfigGraph(file_get_contents('../documents/config.ttl'), $this->mockRequest); $config->init(); $this->SW = new SparqlWriter($config, $this->mockRequest); }
function setup() { $mockRequest = $this->getMock('LinkedDataApiRequest'); $mockRequest->expects($this->any())->method('getParams')->will($this->returnValue(array('localAuthority.code' => '00BX', '_view' => 'detailed'))); $mockRequest->expects($this->any())->method('getUnreservedParams')->will($this->returnValue(array('localAuthority.code' => '00BX'))); $mockRequest->expects($this->any())->method('getBase')->will($this->returnValue("http://example.com")); $mockRequest->expects($this->any())->method('getPath')->will($this->returnValue("/doc/school/12345")); $mockRequest->expects($this->any())->method('getPathWithoutExtension')->will($this->returnValue("/doc/school/12345")); $mockRequest->expects($this->any())->method('getUri')->will($this->returnValue("http://example.com/doc/school/12345")); $ConfigGraph = new ConfigGraph(file_get_contents('../documents/config.ttl'), $mockRequest); $ConfigGraph->add_rdf(file_get_contents('../documents/test-data.ttl')); $ConfigGraph->init(); $this->Graph = new LinkedDataApiGraph(file_get_contents('../documents/test-data.ttl'), $ConfigGraph); $this->Graph->_current_page_uri = "http://localhost/Things?_page=1"; }
function test_getInheritedSelectorFiltersDoesntThrowException() { $mockRequest = $this->getMockRequest('/Climbing/Routes/byGrade/HVS', 'http://localhost'); $Config = new ConfigGraph(file_get_contents('../documents/config.ttl'), $mockRequest); $Config->init(); try { $filters = $Config->getInheritedSelectFilters(); } catch (ConfigGraphException $e) { $this->fail("an exception shouldn't be thrown if the parent selector uses api:filter "); } $this->assertEquals(array('type={Route}'), $filters); }