當前位置: 首頁>>代碼示例>>PHP>>正文


PHP readFixture函數代碼示例

本文整理匯總了PHP中readFixture函數的典型用法代碼示例。如果您正苦於以下問題:PHP readFixture函數的具體用法?PHP readFixture怎麽用?PHP readFixture使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了readFixture函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * Set up the test suite before each test
  */
 public function setUp()
 {
     $this->graph = new EasyRdf_Graph();
     $this->resource = $this->graph->resource('http://www.example.com/');
     $this->parser = new MockParser();
     $this->data = readFixture('foaf.json');
 }
開發者ID:gitter-badger,項目名稱:mexproject,代碼行數:10,代碼來源:ParserTest.php

示例2: testGetDefault

 public function testGetDefault()
 {
     $this->client->addMock('GET', 'http://localhost:8080/data/?default', readFixture('foaf.json'));
     $graph = $this->graphStore->getDefault();
     $this->assertClass('EasyRdf_Graph', $graph);
     $this->assertSame(null, $graph->getUri());
     $this->assertStringEquals('Joe Bloggs', $graph->get('http://www.example.com/joe#me', 'foaf:name'));
 }
開發者ID:takin,項目名稱:workshop-semantic-web,代碼行數:8,代碼來源:GraphStoreTest.php

示例3: testQueryConstructJson

 public function testQueryConstructJson()
 {
     $this->_client->addMock('GET', '/sparql?query=CONSTRUCT+%7B%3Fs+%3Fp+%3Fo%7D+WHERE+%7B%3Fs+%3Fp+%3Fo%7D', readFixture('foaf.json'));
     $graph = $this->_sparql->query("CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}");
     $this->assertType('EasyRdf_Graph', $graph);
     $name = $graph->get('http://www.example.com/joe#me', 'foaf:name');
     $this->assertStringEquals('Joe Bloggs', $name);
 }
開發者ID:portokallidis,項目名稱:Metamorphosis-Meducator,代碼行數:8,代碼來源:ClientTest.php

示例4: testParseQuery

 public function testParseQuery()
 {
     $graph = new EasyRdf_Graph();
     $graph->parse(readFixture('query/construct.ttl'), 'turtle');
     $query = $graph->resource('test:construct');
     $this->assertClass('EasySpinRdf_Query_Construct', $query);
     $this->assertStringEquals("CONSTRUCT { ?this test:grandParent ?grandParent } WHERE { ?parent test:child ?this. ?grandParent test:child ?parent }", $query->getSparql());
 }
開發者ID:conjecto,項目名稱:easyspinrdf,代碼行數:8,代碼來源:ConstructTest.php

示例5: testGetIndirect

 public function testGetIndirect()
 {
     $this->_client->addMock('GET', 'http://localhost:8080/data/?graph=http%3A%2F%2Ffoo.com%2Fbar.rdf', readFixture('foaf.json'));
     $graph = $this->_graphStore->get('http://foo.com/bar.rdf');
     $this->assertType('EasyRdf_Graph', $graph);
     $this->assertEquals('http://foo.com/bar.rdf', $graph->getUri());
     $this->assertStringEquals('Joe Bloggs', $graph->get('http://www.example.com/joe#me', 'foaf:name'));
 }
開發者ID:portokallidis,項目名稱:Metamorphosis-Meducator,代碼行數:8,代碼來源:GraphStoreTest.php

示例6: testGetHeaders

 public function testGetHeaders()
 {
     $response = EasyRdf_Http_Response::fromString(readFixture('http_response_200'));
     $this->assertEquals(8, count($response->getHeaders()), 'Header count is not as expected');
     $this->assertEquals('Apache/2.2.9 (Unix) PHP/5.2.6', $response->getHeader('Server'), 'Server header is not as expected');
     $this->assertEquals('text/plain', $response->getHeader('Content-Type'), 'Content-type header is not as expected');
     $this->assertEquals(array('foo', 'bar'), $response->getHeader('X-Multiple'), 'Header with multiple values is not as expected');
 }
開發者ID:nhukhanhdl,項目名稱:easyrdf,代碼行數:8,代碼來源:ResponseTest.php

示例7: testParseWithFormatObject

 public function testParseWithFormatObject()
 {
     $data = readFixture('foaf.jsonld');
     $format = EasyRdf_Format::getFormat('jsonld');
     $count = $this->parser->parse($this->graph, $data, $format, null);
     $this->assertSame(14, $count);
     $joe = $this->graph->resource('http://www.example.com/joe#me');
     $this->assertStringEquals('Joe Bloggs', $joe->get('foaf:name'));
 }
開發者ID:takin,項目名稱:workshop-semantic-web,代碼行數:9,代碼來源:JsonLdTest.php

示例8: setUp

 public function setUp()
 {
     if (extension_loaded('redland')) {
         $this->_parser = new EasyRdf_Parser_Redland();
         $this->_graph = new EasyRdf_Graph();
         $this->_data = readFixture('foaf.rdf');
     } else {
         $this->markTestSkipped("Redland PHP extension is not available.");
     }
 }
開發者ID:portokallidis,項目名稱:Metamorphosis-Meducator,代碼行數:10,代碼來源:RedlandTest.php

示例9: setUp

 public function setUp()
 {
     if (requireExists('arc/ARC2.php')) {
         $this->_parser = new EasyRdf_Parser_Arc();
         $this->_graph = new EasyRdf_Graph();
         $this->_data = readFixture('foaf.rdf');
     } else {
         $this->markTestSkipped("ARC2 library is not available.");
     }
 }
開發者ID:nhukhanhdl,項目名稱:easyrdf,代碼行數:10,代碼來源:ArcTest.php

示例10: testParseSeq

 public function testParseSeq()
 {
     $count = $this->parser->parse($this->graph, readFixture('rdf-seq.rdf'), 'rdfxml', 'http://www.w3.org/TR/REC-rdf-syntax/');
     $this->assertSame(5, $count);
     $favourites = $this->graph->resource('http://example.org/favourite-fruit');
     $this->assertSame('rdf:Seq', $favourites->type());
     $this->assertStringEquals('http://example.org/banana', $favourites->get('rdf:_1'));
     $this->assertStringEquals('http://example.org/apple', $favourites->get('rdf:_2'));
     $this->assertStringEquals('http://example.org/pear', $favourites->get('rdf:_3'));
     $this->assertStringEquals('http://example.org/pear', $favourites->get('rdf:_4'));
 }
開發者ID:gitter-badger,項目名稱:mexproject,代碼行數:11,代碼來源:RdfXmlTest.php

示例11: setUp

 public function setUp()
 {
     // FIXME: suppress stderr
     // FIXME: check for rapper version 1.4.17
     exec('which rapper', $output, $retval);
     if ($retval == 0) {
         $this->_parser = new EasyRdf_Parser_Rapper();
         $this->_graph = new EasyRdf_Graph();
         $this->_data = readFixture('foaf.rdf');
     } else {
         $this->markTestSkipped("The rapper command is not available on this system.");
     }
 }
開發者ID:portokallidis,項目名稱:Metamorphosis-Meducator,代碼行數:13,代碼來源:RapperTest.php

示例12: setUp

 public function setUp()
 {
     $this->graph = new EasyRdf_Graph();
     $this->graph->parse(readFixture('element/triple_path.ttl'), 'turtle');
 }
開發者ID:conjecto,項目名稱:easyspinrdf,代碼行數:5,代碼來源:TriplePathTest.php

示例13: testLoad

 public function testLoad()
 {
     EasyRdf_Http::setDefaultHttpClient($client = new EasyRdf_Http_MockClient());
     $client->addMock('GET', 'http://example.com/foaf.json', readFixture('foaf.json'));
     $graph = new EasyRdf_Graph('http://example.com/');
     $resource = $graph->resource('http://example.com/foaf.json');
     $resource->load();
     $this->assertStringEquals('Joe Bloggs', $graph->get('http://www.example.com/joe#me', 'foaf:name'));
 }
開發者ID:gitter-badger,項目名稱:mexproject,代碼行數:9,代碼來源:ResourceTest.php

示例14: testIssue115

    /**
     * @see https://github.com/njh/easyrdf/issues/115
     */
    public function testIssue115()
    {
        $triples = <<<RDF
<http://example.com/id/1> <http://www.w3.org/2000/01/rdf-schema#type> <http://example.com/ns/animals/dog> .
<http://example.com/id/2> <http://www.w3.org/2000/01/rdf-schema#type> <http://example.com/ns/animals/cat> .
<http://example.com/id/3> <http://www.w3.org/2000/01/rdf-schema#type> <http://example.com/ns/animals/bird> .
<http://example.com/id/4> <http://www.w3.org/2000/01/rdf-schema#type> <http://example.com/ns/animals/reptiles/snake> .
RDF;
        EasyRdf_Namespace::set('id', 'http://example.com/id/');
        EasyRdf_Namespace::set('animals', 'http://example.com/ns/animals/');
        //  parse graph
        $graph = new EasyRdf_Graph();
        $graph->parse($triples, 'ntriples');
        //  dump as text/turtle
        $turtle = $graph->serialise('turtle');
        $this->assertEquals(readFixture('turtle/gh115-nested-namespaces.ttl'), $turtle);
    }
開發者ID:takin,項目名稱:workshop-semantic-web,代碼行數:20,代碼來源:TurtleTest.php

示例15: setUp

 public function setUp()
 {
     $this->graph = new EasyRdf_Graph();
     $this->parser = new EasyRdf_Parser_Ntriples();
     $this->data = readFixture('foaf.nt');
 }
開發者ID:gitter-badger,項目名稱:mexproject,代碼行數:6,代碼來源:NtriplesTest.php


注:本文中的readFixture函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。