当前位置: 首页>>代码示例>>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;未经允许,请勿转载。