server/src/tests/Models/DocumentTest.php
changeset 497 f3474aeec884
parent 445 b1e5ad6b2a29
child 498 265992e5b379
equal deleted inserted replaced
496:a53762d61c06 497:f3474aeec884
   358                 $this->assertNull($contribDef['name'], 'Name must be null');
   358                 $this->assertNull($contribDef['name'], 'Name must be null');
   359                 $this->assertNull($contribDef['nameLiteral'], 'Name literal must be null');
   359                 $this->assertNull($contribDef['nameLiteral'], 'Name literal must be null');
   360                 $foundJaneAusten = true;
   360                 $foundJaneAusten = true;
   361             }
   361             }
   362         }
   362         }
   363         $this->assertTrue($foundJaneAusten, "Jane austenn not foud");
   363         $this->assertTrue($foundJaneAusten, "Jane Austeen not foud");
   364 
   364 
   365     }
   365     }
   366 
   366 
   367     public function testGetSubjects() {
   367     public function testGetSubjects() {
   368         $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->inputGraphes['TEST']);
   368         $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-CFPP2000_35_SOUND", $this->inputGraphes['TEST']);
   425 
   425 
   426         $json = $doc->jsonSerialize();
   426         $json = $doc->jsonSerialize();
   427 
   427 
   428         $this->assertTrue(is_array($json), 'Returned json must be an array');
   428         $this->assertTrue(is_array($json), 'Returned json must be an array');
   429         $this->assertEquals(
   429         $this->assertEquals(
   430             ["id", "uri", "title", "languages", "modified", "issued", "created", "publishers", "contributors", "subjects", "transcript", "mediaArray", "geoInfo"],
   430             ["id", "uri", "title", "languages", "modified", "issued", "created", "publishers", "contributors", "subjects", "types", "transcript", "mediaArray", "geoInfo"],
   431             array_keys($json)
   431             array_keys($json)
   432         );
   432         );
   433         $this->assertEquals(sprintf('%1$s/crdo-CFPP2000_35_SOUNDid', config('corpusparole.handle_prefix')), $json['id']);
   433         $this->assertEquals(sprintf('%1$s/crdo-CFPP2000_35_SOUNDid', config('corpusparole.handle_prefix')), $json['id']);
   434         $this->assertTrue(is_array($json['transcript']));
   434         $this->assertTrue(is_array($json['transcript']));
   435         $this->assertTrue(is_array($json['mediaArray']));
   435         $this->assertTrue(is_array($json['mediaArray']));
       
   436         $this->assertTrue(is_array($json['subjects']));
       
   437         $this->assertTrue(is_array($json['types']));
   436 
   438 
   437     }
   439     }
   438 
   440 
   439     public function testAddGeoInfo() {
   441     public function testAddGeoInfo() {
   440 
   442