server/src/tests/libraries/Mergers/CocoonTextRdfMergerTest.php
changeset 117 7abc74acf392
parent 116 e60c55988ed4
child 124 93234b0b12f3
--- a/server/src/tests/libraries/Mergers/CocoonTextRdfMergerTest.php	Fri Feb 05 15:08:46 2016 +0100
+++ b/server/src/tests/libraries/Mergers/CocoonTextRdfMergerTest.php	Fri Feb 05 17:01:09 2016 +0100
@@ -122,7 +122,7 @@
           edm:dataProvider "Laboratoire de langues et civilisations à tradition orale" ;
           edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-UVE_MOCIKA_SOUND> ;
           edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/144187.wav> ;
-          edm:rights <http://creativecommons.org/licenses/by-nc-nd/4.0/> ;
+          edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
           edm:hasView <http://cocoon.huma-num.fr/data/archi/144187_MOCIKA_22km.wav>, <http://cocoon.huma-num.fr/data/archi/mp3/144187_MOCIKA_44k.mp3> .
 
         <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-UVE_MOCIKA_SOUND>
@@ -423,6 +423,30 @@
         }
     }
 
+    public function testRightDifferent() {
+        $resGraph = $this->resGraph["SOUND_TEXT"];
+
+        $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
+
+        $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
+
+        $this->assertNotNull($license, "The licence must not be null");
+        $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
+        $this->assertEquals(config('corpusparole.corpus_doc_default_cc_rights'), $license->getUri(), "License must be default licence");
+    }
+
+    public function testRightSame() {
+        $resGraph = $this->resGraph["SOUND_NO_MOD_TEXT"];
+
+        $aggregationRes = $resGraph->get('ore:Aggregation', '^rdf:type');
+
+        $license = $aggregationRes->get('<http://www.europeana.eu/schemas/edm/rights>');
+
+        $this->assertNotNull($license, "The licence must not be null");
+        $this->assertInstanceOf("EasyRdf\Resource", $license, "Licence must be a resource");
+        $this->assertEquals('http://creativecommons.org/licenses/by-nc-sa/4.0/', $license->getUri(), "License must be default licence");
+    }
+
 
 
 }