server/src/tests/libraries/Mappers/CocoonCollectionRdfMapperTest.php
changeset 145 49b75287c30b
parent 144 03678acbfda3
--- a/server/src/tests/libraries/Mappers/CocoonCollectionRdfMapperTest.php	Sat Mar 26 00:24:34 2016 +0100
+++ b/server/src/tests/libraries/Mappers/CocoonCollectionRdfMapperTest.php	Fri Apr 08 17:50:49 2016 +0200
@@ -178,7 +178,6 @@
             'http://purl.org/dc/terms/issued',
             'http://purl.org/dc/elements/1.1/type',
             'http://purl.org/dc/elements/1.1/language',
-            'http://purl.org/dc/terms/isPartOf',
             'http://purl.org/dc/terms/modified',
         ];
 
@@ -216,4 +215,23 @@
 
     }
 
+    /**
+     * Test mapping for isPartOf
+     *
+     * @return void
+     */
+    public function testOneToOneCollectionIsPartOf() {
+        $collection = $this->resGraphes['BASE']->get('edm:Collection', '^rdf:type');
+        $sourceNode = $this->inputGraphes['BASE']->get('http://crdo.risc.cnrs.fr/schemas/Resource', '^rdf:type');
+
+        $this->assertNotNull($collection);
+        $this->assertNotNull($sourceNode);
+
+        $ispartOf = $collection->all('<http://www.europeana.eu/schemas/edm/isGatheredInto>');
+        $this->assertCount(1, $ispartOf, "Must have one collection node");
+
+        $this->assertEquals(config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ALA", strval($collection->get('<http://www.europeana.eu/schemas/edm/isGatheredInto>')), "the isPartOf mus equals ".config('corpusparole.corpus_doc_id_base_uri')."crdo-COLLECTION_ALA");
+    }
+
+
 }