diff -r 86fcf0c837c0 -r 023b6d467566 server/src/tests/Repositories/DocumentRepositoryTest.php --- a/server/src/tests/Repositories/DocumentRepositoryTest.php Mon Mar 21 14:04:19 2016 +0100 +++ b/server/src/tests/Repositories/DocumentRepositoryTest.php Fri Mar 25 17:03:45 2016 +0100 @@ -22,7 +22,7 @@ owl:sameAs ; "northlimit=47.431892250000033; southlimit=49.053971250000046;westlimit=6.846186050000028; eastlimit=8.232571550000074;"^^ , "FR"^^ , "France, Alsace"@fr . - a ; + <%1\$scrdo-ALA_738> a ; ; "Atlas linguistiques, cultures et parlers régionaux de France" ; , ; @@ -78,7 +78,7 @@ public function setUp() { parent::setUp(); - $this->graph = new EasyRdf\Graph("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-ALA_738", DocumentRepositoryTest::TEST_DOC); + $this->graph = new EasyRdf\Graph(config('corpusparole.corpus_doc_id_base_uri')."crdo-ALA_738", sprintf(DocumentRepositoryTest::TEST_DOC, config('corpusparole.corpus_doc_id_base_uri'))); $this->corpusDocIdBaseUri = config('corpusparole.corpus_doc_id_base_uri'); } @@ -109,7 +109,7 @@ $resDoc = $res[0]; $this->assertInstanceOf(Document::class, $resDoc, "Res doc must be a Document"); - $this->assertEquals('corpusparole:crdo-ALA_738', $resDoc->getId(), "id must be crdo..."); + $this->assertEquals(config('corpusparole.corpus_id_scheme').'crdo-ALA_738', $resDoc->getId(), "id must be crdo..."); $this->assertEquals($expectedId, $resDoc->getUri(), 'url must be ...'); $this->assertNotNull($resDoc->getGraph(), 'Graph must be not null'); } @@ -117,7 +117,7 @@ public function testGet() { $expectedId = $this->corpusDocIdBaseUri.'crdo-ALA_738'; - $returnedGraph = new EasyRdf\Graph($expectedId, DocumentRepositoryTest::TEST_DOC); + $returnedGraph = new EasyRdf\Graph($expectedId, sprintf(DocumentRepositoryTest::TEST_DOC, config('corpusparole.corpus_doc_id_base_uri'))); $sparqlClientMock = m::mock('CorpusParole\Libraries\Sparql\SparqlClient'); $sparqlClientMock->shouldReceive('query')->with(\Hamcrest\Text\StringContains::containsString($expectedId)) @@ -127,9 +127,9 @@ $res = $documentRepository->get('crdo-ALA_738'); $this->assertInstanceOf(Document::class, $res, "Result must be of type Document"); - $this->assertEquals('corpusparole:crdo-ALA_738', $res->getId(), 'id should be crdo-ALA_738' ); + $this->assertEquals(config('corpusparole.corpus_id_scheme').'crdo-ALA_738', $res->getId(), 'id should be crdo-ALA_738' ); $this->assertNotNull($res->getGraph(), "Graph shoul not be null"); - $this->assertTrue(EasyRdf\Isomorphic::isomorphic($res->getGraph(), new EasyRdf\Graph($expectedId, DocumentRepositoryTest::TEST_DOC))); + $this->assertTrue(EasyRdf\Isomorphic::isomorphic($res->getGraph(), new EasyRdf\Graph($expectedId, sprintf(DocumentRepositoryTest::TEST_DOC, config('corpusparole.corpus_doc_id_base_uri'))))); } public function testSave() { @@ -142,7 +142,7 @@ $documentRepository = $this->app->make('CorpusParole\Repositories\RdfDocumentRepository', [$sparqlClientMock]); - $doc = new Document("http://corpusdelaparole.huma-num.fr/corpus/res/crdo-ALA_738", $this->graph); + $doc = new Document(config('corpusparole.corpus_doc_id_base_uri')."crdo-ALA_738", $this->graph); $doc->updateDiscourseTypes(['oratory','drama','narrative']); $res = $documentRepository->save($doc);