server/src/tests/Controllers/DocumentListControllerTest.php
changeset 19 eadaf0b8f02e
parent 4 f55970e41793
child 111 af85c436048f
equal deleted inserted replaced
18:f2a40bbc27f6 19:eadaf0b8f02e
     8 /**
     8 /**
     9  *
     9  *
    10  */
    10  */
    11 class DocumentListControllerTest extends TestCase {
    11 class DocumentListControllerTest extends TestCase {
    12 
    12 
    13     const GET_DOC = <<<EOD
    13     const GET_DOC = <<<EOT
    14     @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    14     @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    15     @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    15     @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    16     @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
    16     @prefix sesame: <http://www.openrdf.org/schema/sesame#> .
    17     @prefix owl: <http://www.w3.org/2002/07/owl#> .
    17     @prefix owl: <http://www.w3.org/2002/07/owl#> .
    18     @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
    18     @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
    19     @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
    19     @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
    20 
    20 
    21     <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-BOD092_SOUND> <http://purl.org/dc/elements/1.1/title> "Corpus LS émergente, L'oncle Geraldo, raconté par Ivaldo"@fr ;
    21     _:genid-25e7608caea646d5ba7b21eaf92c050f-genid1 a <http://www.europeana.eu/schemas/edm/Place> ;
    22         <http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/202009521> , <http://viaf.org/viaf/74053259> ;
    22     	owl:sameAs <http://sws.geonames.org/3469058/> ;
    23         <http://purl.org/dc/elements/1.1/rights> "Copyright (c) Cuxac, Christian" ;
    23     	<http://www.w3.org/2004/02/skos/core#note> "BR"^^<http://purl.org/dc/terms/ISO3166> , "Brésil, Brasilia"@fr ;
    24         <http://purl.org/dc/elements/1.1/format> "video/mp4"^^<http://purl.org/dc/terms/IMT> ;
    24     	<http://www.w3.org/2003/01/geo/wgs84_pos#lat> "-15.77972"^^xsd:float ;
    25         <http://purl.org/dc/terms/isFormatOf> <http://cocoon.huma-num.fr/data/boutet/BOD092_low.mp4> , <http://cocoon.huma-num.fr/data/boutet/BOD092_low.ogg> ;
    25     	<http://www.w3.org/2003/01/geo/wgs84_pos#long> "-47.92972"^^xsd:float .
    26         <http://purl.org/dc/elements/1.1/subject> <http://lexvo.org/id/iso639-3/und> , "general_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> ;
       
    27         <http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/und> ;
       
    28         <http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> , <http://purl.org/dc/dcmitype/MovingImage> , "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> ;
       
    29         <http://www.language-archives.org/OLAC/1.1/author> "Fusellier-Souza, Ivani" ;
       
    30         <http://www.language-archives.org/OLAC/1.1/interviewer> "Fusellier-Souza, Ivani" ;
       
    31         <http://www.language-archives.org/OLAC/1.1/compiler> "Boutet, Dominique" , "Cuxac, Christian" ;
       
    32         <http://www.language-archives.org/OLAC/1.1/data_inputter> "Fiore, Sonia" , "Lacroix, Magdalena" , "Boutet, Dominique" ;
       
    33         <http://www.language-archives.org/OLAC/1.1/speaker> "Ivaldo, Lucia" ;
       
    34         <http://www.language-archives.org/OLAC/1.1/translator> "Fusellier-Souza, Ivani" ;
       
    35         <http://purl.org/dc/elements/1.1/description> """Cette séquence fait partie du corpus vidéo de Langue des
       
    36             Signes Emergentes utilisé lors de la thèse d'Ivani Fusellier-Souza : le locuteur Ivaldo
       
    37             raconte que son oncle Geraldo est riche mais n'est pas radin, et qu'il y a très
       
    38             longtemps lorsque les affaires marchaient pour son"""@fr ;
       
    39         <http://purl.org/dc/terms/alternative> "Séquence 13, L'oncle Geraldo, raconté par Ivaldo"@fr ;
       
    40         <http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ;
       
    41         <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
       
    42         <http://purl.org/dc/terms/spatial> "Brésil, Brasilia"@fr , "BR"^^<http://purl.org/dc/terms/ISO3166> ;
       
    43         <http://www.w3.org/2003/01/geo/wgs84_pos#long> "-47.9291"^^xsd:float ;
       
    44         <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "-15.7801"^^xsd:float ;
       
    45         <http://purl.org/dc/terms/created> "2001-03"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    46         <http://purl.org/dc/terms/tableOfContents> """00:00:00>00:00:45 Ivaldo raconte que son oncle
       
    47             Geraldo est riche. C'est un homme cultivé, qui a beaucoup d'argent. Il habite près de
       
    48             l'aéroport, où habite également l'amie de Lucia. La femme à Geraldo aussi est riche.
       
    49             00:00:45>00:00:46 Lucia dit qu'il est riche, tant mieux pour lui. 00:00:46>00:01:55
       
    50             Ivaldo raconte que son oncle était riche mais généreux. Il lui donne des billets d'avion
       
    51             pour voyager. Il lui donne également des vêtements. Ensuite, Ivaldo raconte qu'avant,
       
    52             son père était aisé et c'est l'oncle Geraldo qui ne l'était pas. Alors son père aidait
       
    53             l'oncle Geraldo car les affaires allaient bien. Mais par la suite, les affaires ont
       
    54             chutées et pour l'oncle Geraldo elles montaient."""@fr ;
       
    55         <http://purl.org/dc/terms/extent> "PT00H01M54S" ;
       
    56         <http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE> ;
       
    57         <http://purl.org/dc/terms/issued> "2013-06-04T22:39:21+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    58         <http://crdo.risc.cnrs.fr/schemas/master> <http://cocoon.huma-num.fr/data/archi/masters/350801.mp4> ;
       
    59         <http://purl.org/dc/terms/available> "2013-06-04"^^<http://purl.org/dc/terms/W3CDTF> .
       
    60 
    26 
    61     <http://lexvo.org/id/iso639-3/und> rdfs:label "Langue des signes émergente"@fr .
    27     <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-BOD092_SOUND> a <http://www.openarchives.org/ore/terms/Aggregation> ;
       
    28     	<http://www.europeana.eu/schemas/edm/aggregatedCHO> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-BOD092_SOUND> ;
       
    29     	<http://www.europeana.eu/schemas/edm/dataProvider> "Corpus de la Parole"@fr ;
       
    30     	<http://www.europeana.eu/schemas/edm/hasView> <http://cocoon.huma-num.fr/data/boutet/BOD092_low.mp4> , <http://cocoon.huma-num.fr/data/boutet/BOD092_low.ogg> ;
       
    31     	<http://www.europeana.eu/schemas/edm/isShownAt> <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-BOD092_SOUND> ;
       
    32     	<http://www.europeana.eu/schemas/edm/isShownBy> <http://cocoon.huma-num.fr/data/archi/masters/350801.mp4> ;
       
    33     	<http://www.europeana.eu/schemas/edm/provider> "Corpus de la Parole"@fr ;
       
    34     	<http://www.europeana.eu/schemas/edm/rights> <http://creativecommons.org/licenses/by-nc-nd/4.0/> .
    62 
    35 
    63     <http://viaf.org/viaf/202009521> rdfs:label "Boutet, Dominique" ;
    36     <http://cocoon.huma-num.fr/data/archi/masters/350801.mp4> a <http://www.europeana.eu/schemas/edm/WebResources> ;
    64         <http://xmlns.com/foaf/0.1/status> "depositor"^^<http://www.language-archives.org/OLAC/1.1/role> .
    37     	<http://purl.org/dc/elements/1.1/format> "video/mp4"^^<http://purl.org/dc/terms/IMT> ;
       
    38     	<http://purl.org/dc/terms/created> "2001-03"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    39     	<http://purl.org/dc/terms/extent> "PT00H01M54S" ;
       
    40     	<http://purl.org/dc/terms/issued> "2013-06-04T22:39:21+02:00"^^<http://purl.org/dc/terms/W3CDTF> .
    65 
    41 
    66     <http://viaf.org/viaf/74053259> rdfs:label "Cuxac, Christian" ;
    42     <http://cocoon.huma-num.fr/data/boutet/BOD092_low.mp4> a <http://www.europeana.eu/schemas/edm/WebResources> ;
    67         <http://xmlns.com/foaf/0.1/status> "depositor"^^<http://www.language-archives.org/OLAC/1.1/role> .
    43     	<http://purl.org/dc/elements/1.1/format> "video/mp4"^^<http://purl.org/dc/terms/IMT> ;
       
    44     	<http://purl.org/dc/terms/created> "2001-03"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    45     	<http://purl.org/dc/terms/extent> "PT00H01M54S" ;
       
    46     	<http://purl.org/dc/terms/issued> "2013-06-04T22:39:21+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    47     	<http://www.europeana.eu/schemas/edm/isDerivativeOf> <http://cocoon.huma-num.fr/data/archi/masters/350801.mp4> .
    68 
    48 
    69 EOD;
    49     <http://cocoon.huma-num.fr/data/boutet/BOD092_low.ogg> a <http://www.europeana.eu/schemas/edm/WebResources> ;
       
    50     	<http://purl.org/dc/elements/1.1/format> "video/ogg"^^<http://purl.org/dc/terms/IMT> ;
       
    51     	<http://purl.org/dc/terms/created> "2001-03"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    52     	<http://purl.org/dc/terms/extent> "PT00H01M54S" ;
       
    53     	<http://purl.org/dc/terms/issued> "2013-06-04T22:39:21+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    54     	<http://www.europeana.eu/schemas/edm/isDerivativeOf> <http://cocoon.huma-num.fr/data/archi/masters/350801.mp4> .
       
    55 
       
    56     <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-BOD092_SOUND> a <http://www.europeana.eu/schemas/edm/ProvidedCHO> ;
       
    57     	<http://purl.org/dc/terms/created> "2001-03"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    58     	<http://purl.org/dc/terms/extent> "PT00H01M54S" ;
       
    59     	<http://purl.org/dc/terms/issued> "2013-06-04T22:39:21+02:00"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    60     	<http://purl.org/dc/elements/1.1/contributor> <http://viaf.org/viaf/202009521> , <http://viaf.org/viaf/74053259> , "Fiore, Sonia" , <http://viaf.org/viaf/207122465> , "Lacroix, Magdalena" , "Ivaldo" , "Lucia" ;
       
    61     	<http://purl.org/dc/elements/1.1/description> """Cette séquence fait partie du corpus vidéo de Langue des
       
    62     		Signes Emergentes utilisé lors de la thèse d'Ivani Fusellier-Souza : le locuteur Ivaldo
       
    63     		raconte que son oncle Geraldo est riche mais n'est pas radin, et qu'il y a très
       
    64     		longtemps lorsque les affaires marchaient pour son"""@fr ;
       
    65     	<http://purl.org/dc/elements/1.1/language> <http://lexvo.org/id/iso639-3/und> ;
       
    66     	<http://purl.org/dc/elements/1.1/rights> "Copyright (c) Cuxac, Christian" ;
       
    67     	<http://purl.org/dc/elements/1.1/subject> <http://ark.bnf.fr/ark:/12148/cb11946662b> , <http://ark.bnf.fr/ark:/12148/cb119339867> , <http://ark.bnf.fr/ark:/12148/cb11963612g> , "general_linguistics"^^<http://www.language-archives.org/OLAC/1.1/linguistic-field> , <http://ark.bnf.fr/ark:/12148/cb11965628b> , <http://lexvo.org/id/iso639-3/und> , <http://ark.bnf.fr/ark:/12148/cb119677899> , <http://ark.bnf.fr/ark:/12148/cb119511608> , <http://ark.bnf.fr/ark:/12148/cb16648129s> ;
       
    68     	<http://purl.org/dc/elements/1.1/title> "Corpus LS émergente, L'oncle Geraldo, raconté par Ivaldo"@fr ;
       
    69     	<http://purl.org/dc/elements/1.1/type> "dialogue"^^<http://www.language-archives.org/OLAC/1.1/discourse-type> , "primary_text"^^<http://www.language-archives.org/OLAC/1.1/linguistic-type> , <http://purl.org/dc/dcmitype/MovingImage> ;
       
    70     	<http://purl.org/dc/terms/accessRights> "Freely available for non-commercial use" ;
       
    71     	<http://purl.org/dc/terms/available> "2013-06-04"^^<http://purl.org/dc/terms/W3CDTF> ;
       
    72     	<http://purl.org/dc/terms/isPartOf> <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE> ;
       
    73     	<http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc-nd/2.5/> ;
       
    74     	<http://purl.org/dc/terms/spatial> _:genid-25e7608caea646d5ba7b21eaf92c050f-genid1 ;
       
    75     	<http://www.language-archives.org/OLAC/1.1/depositor> <http://viaf.org/viaf/202009521> , <http://viaf.org/viaf/74053259> ;
       
    76     	<http://www.language-archives.org/OLAC/1.1/interviewer> <http://viaf.org/viaf/207122465> ;
       
    77     	<http://www.language-archives.org/OLAC/1.1/speaker> "Ivaldo" , "Lucia" ;
       
    78     	<http://purl.org/dc/terms/tableOfContents> "00:00:00>00:00:45 Ivaldo raconte que son oncle Geraldo est riche. C'est un homme cultivé, qui a beaucoup d'argent. Il habite près de l'aéroport, où habite également l'amie de Lucia. La femme à Geraldo aussi est riche. 00:00:45>00:00:46 Lucia dit qu'il est riche, tant mieux pour lui. 00:00:46>00:01:55 Ivaldo raconte que son oncle était riche mais généreux. Il lui donne des billets d'avion pour voyager. Il lui donne également des vêtements. Ensuite, Ivaldo raconte qu'avant, son père était aisé et c'est l'oncle Geraldo qui ne l'était pas. Alors son père aidait l'oncle Geraldo car les affaires allaient bien. Mais par la suite, les affaires ont chutées et pour l'oncle Geraldo elles montaient."@fr ;
       
    79     	<http://www.language-archives.org/OLAC/1.1/compiler> <http://viaf.org/viaf/202009521> , <http://viaf.org/viaf/74053259> ;
       
    80     	<http://www.language-archives.org/OLAC/1.1/data_inputter> <http://viaf.org/viaf/202009521> , "Fiore, Sonia" , "Lacroix, Magdalena" ;
       
    81     	<http://purl.org/dc/terms/alternative> "Séquence 13, L'oncle Geraldo, raconté par Ivaldo"@fr ;
       
    82     	<http://www.language-archives.org/OLAC/1.1/author> <http://viaf.org/viaf/207122465> ;
       
    83     	<http://www.language-archives.org/OLAC/1.1/translator> <http://viaf.org/viaf/207122465> .
       
    84 EOT;
       
    85 
    70 #""" comment for syntax highliting
    86 #""" comment for syntax highliting
    71 
    87 
    72     private $documentRepository;
    88     private $documentRepository;
    73 
    89 
    74     public function setUp() {
    90     public function setUp() {
   101         $this->assertResponseOk($response);
   117         $this->assertResponseOk($response);
   102         $this->assertViewHas('docs');
   118         $this->assertViewHas('docs');
   103     }
   119     }
   104 
   120 
   105     public function testShow() {
   121     public function testShow() {
   106         $res_doc = new EasyRdf\Graph('http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-BOD092_SOUND',DocumentListControllerTest::GET_DOC);
   122         $res_doc = new EasyRdf\Graph('http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-BOD092_SOUND',DocumentListControllerTest::GET_DOC);
   107         $this->documentRepository
   123         $this->documentRepository
   108             ->shouldReceive('get')
   124             ->shouldReceive('get')
   109             ->once()
   125             ->once()
   110             ->andReturn(new Document('http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-BOD092_SOUND', $res_doc));
   126             ->andReturn(new Document('http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-BOD092_SOUND', $res_doc));
   111 
   127 
   112         $response = $this->visit('/bo/docs/crdo-BOD092_SOUND');
   128         $response = $this->visit('/bo/docs/crdo-BOD092_SOUND');
   113 
   129 
   114     }
   130     }
   115 }
   131 }