server/src/tests/libraries/Mappers/CocoonTextRdfMapperTest.php
changeset 125 e550b10fe3ca
parent 122 b37fde30dd4a
child 143 023b6d467566
equal deleted inserted replaced
124:93234b0b12f3 125:e550b10fe3ca
   239             $this->assertEquals("dc:IMT",$mimetype->getDatatype());
   239             $this->assertEquals("dc:IMT",$mimetype->getDatatype());
   240         }
   240         }
   241     }
   241     }
   242 
   242 
   243      /**
   243      /**
   244       * Test that the web resources
   244       * Test that the web resources has good date
   245       *
   245       *
   246       * @return void
   246       * @return void
   247       */
   247       */
   248     public function testWebResourcesDate() {
   248     public function testWebResourcesDate() {
   249 
   249 
   263         }
   263         }
   264 
   264 
   265     }
   265     }
   266 
   266 
   267 
   267 
       
   268     /**
       
   269      * Test that the web resources as conformsTo property
       
   270      *
       
   271      * @return void
       
   272      */
       
   273    public function testWebResourcesConformsTo() {
       
   274 
       
   275        $resources = $this->resGraphes['BASE']->allOfType('edm:WebResource');
       
   276        foreach ($resources as $wres) {
       
   277 
       
   278            $mimetypes = $wres->all($this->resGraphes['BASE']->resource('http://purl.org/dc/elements/1.1/format'));
       
   279            $mimetype = $mimetypes[0]->getValue();
       
   280            if($mimetype !== 'application/xml') {
       
   281                continue;
       
   282            }
       
   283            $conformsTo = $wres->get('<http://purl.org/dc/terms/conformsTo>');
       
   284            $this->assertNotNull($conformsTo, "Must have a conformsTo node");
       
   285            $this->assertInstanceOf('EasyRdf\Resource', $conformsTo, "Must be a resource");
       
   286            $this->assertEquals("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive", $conformsTo->getUri(), "Must be http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-dtd_archive");
       
   287        }
       
   288    }
       
   289 
       
   290 
   268 }
   291 }