server/src/tests/Models/DocumentTest.php
author ymh <ymh.work@gmail.com>
Tue, 01 Dec 2015 13:33:08 +0100
changeset 20 a9b98b16b053
parent 19 eadaf0b8f02e
child 28 b0b56e0f8c7f
permissions -rw-r--r--
add contributor list + edition pane
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
use CorpusParole\Models\Document;
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
     4
use CorpusParole\Libraries\CocoonUtils;
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
/**
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 *
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 */
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
class DocumentTest extends TestCase {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    const TEST_DOC = <<<EOT
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    12
    @prefix ore: <http://www.openarchives.org/ore/terms/> .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    13
    @prefix edm: <http://www.europeana.eu/schemas/edm/> .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    14
    @prefix dc11: <http://purl.org/dc/elements/1.1/> .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    15
    @prefix olac: <http://www.language-archives.org/OLAC/1.1/> .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    16
    @prefix dc: <http://purl.org/dc/terms/> .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    17
    @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    18
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    19
    @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    20
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    21
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    22
    <http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    23
      a ore:Aggregation ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    24
      edm:aggregatedCHO <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    25
      edm:provider "Corpus de la Parole"@fr ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    26
      edm:dataProvider <http://viaf.org/viaf/142432638> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    27
      edm:isShownAt <http://cocoon.huma-num.fr/exist/crdo/meta/crdo-CFPP2000_35_SOUND> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    28
      edm:isShownBy <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    29
      edm:rights <http://creativecommons.org/licenses/by-nc-sa/4.0/> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    30
      edm:hasView <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav>, <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3>, <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml>,  <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml>.
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    31
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    32
    <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-CFPP2000_35_SOUND>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    33
      a edm:ProvidedCHO ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    34
      dc11:description "Enregistrement issu du Corpus de Français Parlé Parisien des années 2000 (CFPP2000)"@fr, "Enregistrement: Caractéristiques de l'enregistrement; Identifiant : CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e; Langue : français; Editeur : Université Paris III – Syled ; Date : 17.11.2010; Lieu de l'enregistrement : au domicile de l’enquêté Özgur KILIÇ ; Enquêteur : Sonia BRANCA-ROSOFF; Quartier(s) concerné(s) : Paris 3e, et 20e (pour l’âge adulte); Transcription : Noalig TANGUY; Anonymisation : Noalig TANGUY; Durée : 0h46’; "@fr, "Enquêteur: Etat civil; Prénom et NOM : Sonia BRANCA-ROSOFF; Sexe : féminin; Lieu de naissance : New-York (USA); Lieu la petite enfance : Bretagne, puis région parisienne, puis de 8 à 16 ans Nice; Date de naissance : 16.12.1947; Situation familiale : mariée, deux enfants; Mobilité géographique : Paris 1967-1971, Aix-en-Provence 1971-1996, Paris 1996-2012; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année d’obtention : Doctorat d’État (sciences du langage) 1987; Travail; Activité actuelle : Enseignante-chercheuse (linguistique française), Université de la Sorbonne Nouvelle-Paris III, Paris; Activités passées : ; Langues; Langue première : français; Parents (profession, lieu de naissance, scolarité…); Mère : née en 1916 à Nice (France), interprète de conférences ; licence d’anglais; Père : né en 1913 à Mananjary (Madagascar), ingénieur.; "@fr, "Enquêté 1: Etat civil; Prénom et NOM fictifs : Özgur KILIÇ ; Sexe : masculin; Lieu de naissance: Paris 11e, France; Lieu la petite enfance : Paris 11e, France; Date de naissance : 07.02.1979; Age au moment de l’enregistrement : 32 ans; Situation familiale : pacsé, deux enfants; Mobilité géographique : 3e, 18e, 20e arrondissements; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : amis; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année d’obtention : ; Précisions : Primaire  st Merri 75003 ; Secondaire : Victor Hugo, Turgot 75003, Jean Lurçat 75013 général bac ES Supérieur. Puis St Denis université (cinéma); Travail; Activité actuelle : ingénieur du son pour l'audiovisuel; Activités passées : restauration, assistant son pour l'audiovisuel ; Langues; Langues pratiquées : français, anglais, turc; Parents (profession, lieu de naissance, scolarité…); Mère : psychothérapeute, né a Houilles région parisienne France; Père : professeur d'université, né a Istanbul en Turquie.  ; "@fr, "Enquêté 2: Etat civil; Prénom et NOM fictifs : Michel CHEVRIER; Sexe : masculin; Lieu de naissance : naissance à Boulogne-Billancourt (92); Lieu la petite enfance : rue du Temple, 3e arrondissement, Paris; Date de naissance : 01.06.1979; Age au moment de l’enregistrement : 31 ans; Situation familiale : concubinage; Mobilité géographique : 3e, puis 20e (entre 2005 et 2009) puis Romainville (depuis 2009); Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Réseau par lequel contacté : ; Adresse (si connue) : ; Téléphone (si connu) : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année d’obtention : ; Précisions : Primaire : École à aire ouverte rue St Merri 75003 ; Secondaire (Collège Victor Hugo 75003) puis Lycée Autogéré de Paris (75015) Bac Littéraire. Deux années au CIM (école de jazz) dans le 75018, puis 3 ans au conservatoire du 9eme; Travail; Activité actuelle : Musicien, Compositeur, Professeur de piano jazz ; Activités passées : Musicien; Langues; Langues pratiquées : français, anglais; Parents (profession, lieu de naissance, scolarité…); Mère : ancienne médecin généraliste pneumologue, puis sociologue, née en France; Père : enseignant en sciences de l'éducation à Paris 8 né en Belgique; "@fr, "Enquêté 3: Etat civil; Prénom et NOM fictifs : Benoît DU BREUIL-DE-PONT-EN-AUGE; Sexe : masculin; Lieu de naissance : Paris 14e; Lieu la petite enfance :  Paris 3e; Date de naissance : 28.11.1978; Age au moment de l’enregistrement : 32 ans; Situation familiale : concubinage avéré, avec papier de la mairie tamponné et signé!; Mobilité géographique : à 2 ans vit dans le 9°, puis déménage pour le 3°, est resté dans la même rue pendant 20 ans tout en changeant d'immeuble. Ensuite le 19° pendant 4 ans, puis Pantin 6 mois puis Les Lilas. ; Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec autres enquêtés : voir Scolarité, Précisions; Prénom et NOM réels : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [ ] Post-licence [ ] ; Dernier diplôme, avec année d’obtention : CAP; Précisions : Primaire école à aire ouverte (St Merri) dans le 4° avec Augustin, Ôzgur, Michel. Secondaire : collège Victor-Hugo dans le 3° avec Ôzgur ; puis CAP ; Travail; Activité actuelle : ; Activités passées : ébéniste agenceur puis ébéniste restaurateur et enfin constructeur décors (ainsi que de nombreux petits jobs ayant duré moins d'un an); Langues; Langues pratiquées : français; Parents (profession, lieu de naissance, scolarité…); Mère : à la retraite ; secrétaire de rédaction dans un grand journal, baccalauréat ; née à Montrouge; Père : conseiller à travail à pole emploi, né à Boulogne Billancourt, baccalauréat présenté 3 ou 4 fois, puis obtenu par équivalence. ; "@fr, "Enquêté 4: Etat civil; Enquêté 4; Prénom et NOM fictifs : ; Sexe : féminin / masculin; Lieu de naissance : Paris 14e; Lieu de la petite enfance : Paris 4e et 3e ; Date de naissance : 06.12.1976; Age au moment de l’enregistrement : 34 ans; Situation familiale : ; Mobilité géographique : Rue la Bruyère 75009 (1976-1978), Rambuteau 75004 (1978-1987/88) & 75003 (chgt de côté de rue 1988-1998), a quitté Paris de 1998 à 2005 ; Rue Rambuteau 75003 (2006-2010), rue Gossec 75012 (2011); Relation (parenté, ami, etc) avec Enquêteur : aucune; Relation (parenté, ami, etc) avec Enquêté 2 : ami; Relation (parenté, ami, etc) avec Enquêté NOM : ; Réseau par lequel contacté : ; Scolarité; Niveau : Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [X] ; Dernier diplôme, avec année d’obtention : ; Précisions : Primaire : Ecole St Merri 75003. Secondaire : Collège François Couperin 75004, Institut St Pierre Fourier 75012 ; Cours Charlemagne 75014 ; Travail; Activité actuelle : Superviseur Centre d'appels ; Activités passées : Animateur Club Enfant, Réceptionniste ; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolarité…); Mère : retraitée, Paris, bac + 1/2 (?) ; Père : Conseiller Pôle Emploi, Paris, bac. ; "@fr, "Enquêté 5: Etat civil; Prénom et NOM fictifs : Étienne SALVEGAS; Sexe : masculin; Lieu de naissance : Paris 12e; Lieu de la petite enfance : Paris 3e Le Marais; Date de naissance :  16.06.1978; Age au moment de l’enregistrement : 32 ans; Situation familiale : marié 1 enfant, 12 ans de vie commune ; Mobilité géographique : 3e (1978-1999) 19e (1999-2002) 9e (2002-2011) ; Relation (parenté, ami, etc) avec Enquêteur : ; Relation (parenté, ami, etc) avec Enquêté 2 : ami ; Relation (parenté, ami, etc) avec Enquêté NOM : ; Prénom et NOM réels : ; Scolarité; Primaire [X] Secondaire [X] ; Supérieur : Licence [X] Post-licence [ ] ; Dernier diplôme, avec année d’obtention : ; Précisions : Primaire : Ecole Vertus, rue des Vertus 3ème. Secondaire Collège Montgolfier / Lycée Turgot 3ème. Supérieur Droit Univ. Paris Panthéon Sorbonne ; Travail; Activité actuelle : évènementiel; Activités passées : stagiaire journaliste sportif / relations publiques, accueil, agent de  sécurité, remplacement gardien, réceptionniste hôtellerie.; Langues; Langues pratiquées :; Parents (profession, lieu de naissance, scolarité…); Mère : né à Paris, lycée ; Père : né à Oloron (64), lycée ; "@fr ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    35
      dc11:language <http://lexvo.org/id/iso639-3/fra> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    36
      dc11:publisher <http://viaf.org/viaf/142432638> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    37
      dc11:type <http://purl.org/dc/dcmitype/Sound>, "primary_text"^^olac:linguistic-type, "narrative"^^olac:discourse-type, "report"^^olac:discourse-type, "unintelligible_speech"^^olac:discourse-type ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    38
      dc:license <http://creativecommons.org/licenses/by-nc-sa/3.0/> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    39
      dc11:subject "lexicography"^^olac:linguistic-field, "phonetics"^^olac:linguistic-field, "anthropological_linguistics"^^olac:linguistic-field, "general_linguistics"^^olac:linguistic-field, <http://lexvo.org/id/iso639-3/fra>, "text_and_corpus_linguistics"^^olac:linguistic-field, "phonology"^^olac:linguistic-field, "semantics"^^olac:linguistic-field, "sociolinguistics"^^olac:linguistic-field, "syntax"^^olac:linguistic-field, "typology"^^olac:linguistic-field, "discourse_analysis"^^olac:linguistic-field, "historical_linguistics"^^olac:linguistic-field, "language_documentation"^^olac:linguistic-field, "mathematical_linguistics"^^olac:linguistic-field ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    40
      dc11:title "CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2"@fr ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    41
      dc:accessRights "Freely available for non-commercial use" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    42
      dc:extent "PT48M26S" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    43
      dc:isPartOf <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_LANGUESDEFRANCE>, <http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-COLLECTION_CFPP2000> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    44
      dc11:source "CFPP2000"@fr ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    45
      dc11:coverage "Quartier concerné : 3e"@fr ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    46
      olac:depositor <http://viaf.org/viaf/93752300> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    47
      dc11:contributor <http://viaf.org/viaf/93752300>, "Branca-Rosoff, Sonia", "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne", "Tanguy Noalig" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    48
      olac:interviewer "Branca-Rosoff, Sonia" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    49
      olac:responder "Kiliç Ozgur", "Chevrier Michel", "du-Breuil-de-Pont-en-Auge Benoît", "du-Breuil-de-Pont-en-Auge Augustin", "Salvegas Etienne" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    50
      olac:transcriber "Tanguy Noalig" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    51
      dc:available "2013-10-12"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    52
      dc:created "2010-11-17"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    53
      dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    54
      dc:spatial [
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    55
        a edm:Place ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    56
        geo:lat "48.83975"^^xsd:float ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    57
        geo:long "2.3542"^^xsd:float ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    58
        skos:note "FR"^^dc:ISO3166, "France, Paris, Université Sorbonne Nouvelle Paris 3, site Censier"@fr ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    59
        owl:sameAs <http://vocab.getty.edu/tgn/7008038>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    60
      ] .
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    61
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    62
    <http://cocoon.huma-num.fr/data/archi/masters/372593.wav>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    63
      a edm:WebResources ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    64
      dc:extent "PT48M26S" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    65
      dc11:format "audio/x-wav"^^dc:IMT ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    66
      dc:created "2010-11-17"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    67
      dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    68
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    69
    <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    70
      a edm:WebResources ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    71
      dc:extent "PT48M26S" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    72
      dc11:format "audio/x-wav"^^dc:IMT ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    73
      edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    74
      dc:created "2010-11-17"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    75
      dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF .
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    76
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    77
    <http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    78
      a edm:WebResources ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    79
      dc:extent "PT48M26S" ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    80
      dc11:format "audio/mpeg"^^dc:IMT ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    81
      edm:isDerivativeOf <http://cocoon.huma-num.fr/data/archi/masters/372593.wav> ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    82
      dc:created "2010-11-17"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    83
      dc:issued "2013-10-12T14:35:57+02:00"^^dc:W3CDTF .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    84
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    85
    <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    86
        a edm:WebResources ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    87
        dc11:format "application/xml"^^dc:IMT ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    88
        dc:created "2010-11-17"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    89
        dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF .
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    90
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    91
    <http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml>
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    92
        a edm:WebResources ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    93
        dc11:format "application/xhtml+xml"^^dc:IMT ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    94
        dc:created "2010-11-17"^^dc:W3CDTF ;
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    95
        dc:issued "2013-11-04T22:20:07+01:00"^^dc:W3CDTF .
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
EOT;
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
    public function setUp() {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
        parent::setup();
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   102
        $this->graph = new EasyRdf\Graph("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
    public function testConstructor() {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
        $this->assertNotNull($this->graph, 'Graph shoud not be null');
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   109
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   111
        $this->assertEquals('crdo-CFPP2000_35_SOUND',$doc->getId(),'Must have the correct id');
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
    public function testTitle() {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
        $this->assertNotNull($this->graph, 'Graph shoud not be null');
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   117
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   119
        $this->assertEquals("CFPP2000 [03-01] Ozgur_Kilic_H_32_alii_3e Entretien de Ozgur KILIÇ 2",$doc->getTitle(),'Must have correct title');
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   120
        $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getTitle(), "Title must be a literal");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
        $this->assertEquals('fr', $doc->getTitle()->getLang(), "Language title must be fr");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   124
    public function testModified() {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   125
        $this->assertNotNull($this->graph, 'Graph shoud not be null');
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   126
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   127
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   128
        $this->assertInstanceOf(EasyRdf\Literal::class, $doc->getModified(), "Modified must be a literal");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   129
        $this->assertEquals("http://purl.org/dc/terms/W3CDTF", $doc->getModified()->getDatatypeURI(), "type must be http://purl.org/dc/terms/W3CDTF");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   130
        $this->assertEquals("2013-10-12T14:35:57+02:00", $doc->getModified(), "modified must be 2013-10-12T14:35:57+02:00");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   131
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   132
    }
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   133
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   134
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
    public function testPublisher() {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   137
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
        $this->assertCount(1, $doc->getPublishers(), 'Publisher is an array of size 1');
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   140
        $this->assertInstanceOf('EasyRdf\Resource', $doc->getPublishers()[0], 'publisher is a resource');
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   141
        $this->assertEquals("http://viaf.org/viaf/142432638", $doc->getPublishers()[0]->getUri(),"");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
    public function testMediaArray() {
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   145
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   147
        $this->assertCount(5, $doc->getMediaArray(), "Media array must be of size 5");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   148
        foreach($doc->getMediaArray() as $url => $media) {
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   149
            $this->assertCount(5, $media, "media is a 5 element array");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
            $this->assertArrayHasKey('format', $media, "media has 'format key'");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   151
            $this->assertArrayHasKey('url', $media, "media has url");
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   152
            $this->assertArrayHasKey('extent', $media, "media has extent");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   153
            $this->assertArrayHasKey('extent_ms', $media, "media has extent_ms");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   154
            $this->assertArrayHasKey('master', $media, "media has master");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   155
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   156
            $this->assertEquals($media['url'], $url);
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   157
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   158
            $this->assertContains(
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   159
                $media['url'],
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   160
                [ "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav",
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   161
                  "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3",
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   162
                  "http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xml",
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   163
                  "http://cocoon.huma-num.fr/exist/crdo/cfpp2000/fra/Ozgur_Kilic_H_32_alii_3e-2.xhtml",
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   164
                  "http://cocoon.huma-num.fr/data/archi/masters/372593.wav"
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   165
                ]
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   166
            );
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   167
            if($url === "http://cocoon.huma-num.fr/data/archi/masters/372593.wav") {
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   168
                $this->assertEquals('audio/x-wav', $media['format']);
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   169
                $this->assertTrue($media['master'] === true, "should be master");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   170
            }
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   171
            else {
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   172
                $this->assertTrue($media['master'] === false, "should not be master");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   173
            }
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   174
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   175
            if( $url === "http://cocoon.huma-num.fr/data/archi/masters/372593.wav" ||
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   176
                $url === "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.mp3" ||
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   177
                $url === "http://cocoon.huma-num.fr/data/cfpp2000/Ozgur_Kilic_H_32_alii_3e-2.wav" ) {
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   178
                $this->assertEquals("PT48M26S", $media['extent'], "extent is PT48M26S");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   179
                $this->assertGreaterThan(0, $media['extent_ms'], "extent_ms must be > 0");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   180
                $this->assertStringStartsWith('audio/', $media['format']);
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   181
            }
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   182
            else {
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   183
                $this->assertNull($media['extent'], "no media extent");
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   184
                $this->assertNull($media['extent_ms'], "extend in ms is null");
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   185
                $this->assertStringStartsWith('application/', $media['format']);
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   186
            }
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   187
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
        }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
    public function testGetTypes() {
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   192
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   194
        $this->assertCount(5, $doc->getTypes(), "types array must be of size 5");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
        foreach($doc->getTypes() as $type) {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
            $this->assertThat(
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
                $type,
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
                $this->logicalXor(
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   200
                    $this->isInstanceOf(EasyRdf\Literal::class),
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   201
                    $this->isInstanceOf(EasyRdf\Resource::class)
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
                )
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   203
            );
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
        }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   205
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
    public function testGetOtherTypes() {
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   208
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
        $this->assertCount(2, $doc->getOtherTypes(), "types array must be of size 3");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
        foreach($doc->getTypes() as $type) {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   213
            $this->assertThat(
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
                $type,
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
                $this->logicalXor(
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   216
                    $this->isInstanceOf(EasyRdf\Literal::class),
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   217
                    $this->isInstanceOf(EasyRdf\Resource::class)
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
                )
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
            );
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
        }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   221
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   222
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   223
    public function testGetDiscourseTypes() {
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   224
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   225
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   226
        $this->assertCount(3, $doc->getDiscourseTypes(), "types array must be of size 3");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   227
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   228
        $this->assertContainsOnlyInstancesOf("EasyRdf\Literal", $doc->getDiscourseTypes(), "Result contains only literals");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   229
        $type = $doc->getDiscourseTypes()[0];
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   230
        $this->assertEquals("narrative", $type->getValue(), "discourse type is narrative");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   231
        $this->assertEquals("http://www.language-archives.org/OLAC/1.1/discourse-type", $type->getDatatypeUri(), "discourse type url");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   232
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   233
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
    public function testCloneDocument() {
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   235
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   236
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   237
        $doc2 = clone $doc;
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   238
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
        $this->assertNotSame($doc, $doc2, "documents must not be the same");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   240
        $this->assertNotSame($doc->getGraph(), $doc2->getGraph(), "documents must not be the same");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   241
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   242
        $this->assertTrue(EasyRdf\Isomorphic::isomorphic($doc->getGraph(), $doc2->getGraph()),"graph must be isomorphic");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   243
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   244
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   245
    public function testIsIsomorphic() {
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   246
        $doc1 = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   247
        $doc2 = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", new EasyRdf\Graph("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC));
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   248
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   249
        $this->assertTrue($doc1->isIsomorphic($doc2),"document must be isomorphic");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   250
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   251
        $doc2->addLiteral('dc11:type', new EasyRdf\Literal("oratory", null, Config::get('OLAC_DISCOURSE_TYPE')['uri']));
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   252
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   253
        $this->assertFalse($doc1->isIsomorphic($doc2),"document must not be isomorphic");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   254
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   255
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   256
    public function testUpdateDiscourseTypes() {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   257
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   258
        $newDiscourseTypes = ['oratory','dialogue','narrative', 'formulaic', 'ludic'];
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   259
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   260
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   261
        $this->assertCount(3, $doc->getDiscourseTypes(), "types array must be of size 3");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   262
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   263
        $doc->updateDiscourseTypes($newDiscourseTypes);
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   264
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   265
        $this->assertCount(5, $doc->getDiscourseTypes(), "types array must be of size 5");
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   266
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   267
        $discourseTypes = $doc->getDiscourseTypes();
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   268
        foreach($newDiscourseTypes as $dt) {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   269
            $this->assertContains($dt, $discourseTypes, "all discourse types must be in result list");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   270
        }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   271
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   272
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   273
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   274
    public function testUpdateDiscourseTypesDelta() {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   275
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   276
        $newDiscourseTypes = ['oratory','dialogue','narrative', 'formulaic', 'ludic'];
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   277
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   278
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   279
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   280
        $doc->updateDiscourseTypes($newDiscourseTypes);
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   281
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   282
        $this->assertTrue($doc->isDirty());
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   283
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   284
        $this->assertEquals(1, $doc->deltaCount(), "There is one delta");
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   285
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   286
        $delta = $doc->getDeltaList()[0];
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   287
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   288
        $this->assertEquals("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $delta->getDeletedGraph()->getUri(), "uri of deleted graph must be ok");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   289
        $this->assertEquals("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $delta->getAddedGraph()->getUri(), "uri of added graph must be ok");
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   290
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   291
        $this->assertEquals(3, $delta->getDeletedGraph()->countTriples(), "deleted graph must have only 3 triples");
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   292
        $this->assertEquals(5, $delta->getAddedGraph()->countTriples(), "deleted graph must have only 5 triples");
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   293
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   294
        $resQueryDiscourseType = $delta->getAddedGraph()->allLiterals($doc->getProvidedCHO(), 'dc11:type');
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   295
        foreach($resQueryDiscourseType as $dt) {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   296
            $this->assertInstanceOf(EasyRdf\Literal::class, $dt, "This must be a litteral");
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   297
            $this->assertEquals('http://www.language-archives.org/OLAC/1.1/discourse-type', $dt->getDatatypeUri(), "The type of the Litteral must be correct");
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   298
        }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   299
        foreach($newDiscourseTypes as $dt) {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   300
            $this->assertContains($dt, $resQueryDiscourseType, "all discourse types must be in result list");
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   301
        }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   302
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   303
    }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
   304
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   305
    public function testUpdateDiscourseTypesIsomorphic() {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   306
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   307
        $newDiscourseTypes = ['oratory','dialogue','narrative'];
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   308
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   309
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   310
        $doc->updateDiscourseTypes($newDiscourseTypes);
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   311
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   312
        $doc2 = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", new EasyRdf\Graph("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", DocumentTest::TEST_DOC));
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   313
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   314
        $this->assertFalse($doc->isIsomorphic($doc2),"document must not be isomorphic after adding discourse type");
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   315
    }
19
eadaf0b8f02e Bo conception step. back to ember page
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
   316
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   317
    public function testGetContributors() {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   318
        $doc = new Document("http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-CFPP2000_35_SOUND", $this->graph);
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   319
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   320
        $contributors = $doc->getContributors();
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   321
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   322
        $this->assertNotEmpty($contributors, "The contributors array should not be empty");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   323
        $this->assertCount(8, $contributors, "The contributors array should have 8 elements");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   324
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   325
        foreach ($contributors as $contribDef) {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   326
            $this->assertArrayHasKey('name', $contribDef, "ContribDef must have name key");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   327
            $this->assertArrayHasKey('url', $contribDef, "ContribDef must have url key");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   328
            $this->assertArrayHasKey('role', $contribDef, "ContribDef must have role key");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   329
            $this->assertContains($contribDef['role'], CocoonUtils::OLAC_ROLES, "Role should be in OLAC_ROLES");
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   330
        }
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   331
    }
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 19
diff changeset
   332
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
   333
}