server/src/tests/libraries/Mappers/CocoonTextRdfMapperTest.php
changeset 115 34ffc04cef62
parent 114 8af5ed0521a2
child 116 e60c55988ed4
equal deleted inserted replaced
114:8af5ed0521a2 115:34ffc04cef62
    85     public function testInit()
    85     public function testInit()
    86     {
    86     {
    87         $this->assertTrue(true);
    87         $this->assertTrue(true);
    88     }
    88     }
    89 
    89 
       
    90 
    90     /**
    91     /**
    91      * Test that the returned graph has the same uri that the original.
    92      * Test that the returned graph has the same uri that the original.
    92      *
    93      *
    93      * @return void
    94      * @return void
    94      */
    95      */
   113         $this->assertCount(1, $resources, "Must found only one resources of type ore:Aggregation");
   114         $this->assertCount(1, $resources, "Must found only one resources of type ore:Aggregation");
   114         $this->assertEquals(CocoonTextRdfMapperTest::TEST_GRAPH_URI,$resources[0]->getUri());
   115         $this->assertEquals(CocoonTextRdfMapperTest::TEST_GRAPH_URI,$resources[0]->getUri());
   115     }
   116     }
   116 
   117 
   117     /**
   118     /**
       
   119      * Test providedCHO identifier.
       
   120      *
       
   121      * @return void
       
   122      */
       
   123     public function testProvidedChoId() {
       
   124         $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
       
   125 
       
   126         $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
       
   127         $providedCHO = $resources[0];
       
   128 
       
   129         $identifier = $providedCHO->getLiteral('<http://purl.org/dc/terms/identifier>');
       
   130 
       
   131         $this->assertInstanceOf('EasyRdf\Literal', $identifier, "identifier value must be a literal");
       
   132         $this->assertEquals(CocoonTextRdfMapperTest::TEST_INPUT_ID, $identifier->getValue(), "Value must be equals to ".CocoonTextRdfMapperTest::TEST_INPUT_ID);
       
   133 
       
   134     }
       
   135 
       
   136     /**
   118      * Test providedCHO uri.
   137      * Test providedCHO uri.
   119      *
   138      *
   120      * @return void
   139      * @return void
   121      */
   140      */
   122     public function testProvidedChoURI() {
   141     public function testProvidedChoURI() {
   123         $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
   142         $resources = $this->resGraphes['BASE']->allOfType('edm:ProvidedCHO');
   124 
   143 
   125         $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
   144         $this->assertCount(1, $resources, "Must found only one resources of type edm:ProvidedCHO");
   126         $this->assertEquals(CocoonTextRdfMapperTest::TEST_CHO_URI,$resources[0]->getUri());
   145         $this->assertEquals(CocoonTextRdfMapperTest::TEST_CHO_URI,$resources[0]->getUri());
   127     }
   146     }
       
   147 
       
   148 
   128 
   149 
   129     /**
   150     /**
   130      * Test that the returned graph does not have a http://purl.org/dc/dcmitype/Sound type
   151      * Test that the returned graph does not have a http://purl.org/dc/dcmitype/Sound type
   131      *
   152      *
   132      * @return void
   153      * @return void