upgrade libs and correct tests
authorymh <ymh.work@gmail.com>
Thu, 10 Dec 2015 18:57:58 +0100
changeset 26 72f51a9386ff
parent 25 4ce76c9e7729
child 27 a2342f26c9de
upgrade libs and correct tests
server/src/tests/Repositories/DocumentRepositoryIntegrationTest.php
server/src/tests/Repositories/DocumentRepositoryTest.php
server/src/tests/Services/ViafResolverTest.php
--- a/server/src/tests/Repositories/DocumentRepositoryIntegrationTest.php	Thu Jan 14 18:35:23 2016 +0100
+++ b/server/src/tests/Repositories/DocumentRepositoryIntegrationTest.php	Thu Dec 10 18:57:58 2015 +0100
@@ -138,7 +138,7 @@
         $this->assertInstanceOf(Document::class, $resDoc, "Res doc must be a Document");
         $this->assertEquals('crdo-ALA_738', $resDoc->getId(), "id must be crdo...");
         $this->assertEquals($expectedId, $resDoc->getUri(), 'url must be ...');
-        $this->assertNull($resDoc->getGraph(), 'Graph must be null');
+        $this->assertNotNull($resDoc->getGraph(), 'Graph must not be null');
 
     }
 
--- a/server/src/tests/Repositories/DocumentRepositoryTest.php	Thu Jan 14 18:35:23 2016 +0100
+++ b/server/src/tests/Repositories/DocumentRepositoryTest.php	Thu Dec 10 18:57:58 2015 +0100
@@ -92,6 +92,8 @@
         $returnedArray = [
             m::mock('resObj', function($mock) use (&$expectedId) {
                 $mock->uri = new EasyRdf\Resource($expectedId);
+                $mock->doc = new EasyRdf\Resource("http://purl.org/poi/crdo.vjf.cnrs.fr/crdo-ALA_738");
+                $mock->title = new EasyRdf\Literal("Atlas Linguistique et ethnographique de l'Alsace - Enquetes sur la conscience linguistique - ALA_738", null, "fr");
             }),
         ];
 
@@ -108,7 +110,7 @@
         $this->assertInstanceOf(Document::class, $resDoc, "Res doc must be a Document");
         $this->assertEquals('crdo-ALA_738', $resDoc->getId(), "id must be crdo...");
         $this->assertEquals($expectedId, $resDoc->getUri(), 'url must be ...');
-        $this->assertNull($resDoc->getGraph(), 'Graph must be null');
+        $this->assertNotNull($resDoc->getGraph(), 'Graph must be not null');
     }
 
     public function testGet() {
--- a/server/src/tests/Services/ViafResolverTest.php	Thu Jan 14 18:35:23 2016 +0100
+++ b/server/src/tests/Services/ViafResolverTest.php	Thu Dec 10 18:57:58 2015 +0100
@@ -126,7 +126,7 @@
     /**
      * Test exception 401
      * @expectedException        CorpusParole\Services\ViafResolverException
-     * @expectedExceptionMessage Client error: 401
+     * @expectedExceptionMessage Client error: `GET http://viaf.org/viaf/12345/` resulted in a `401 Unauthorized` response:
      * @expectedExceptionCode 401
      */
     public function test401Error() {
@@ -139,7 +139,7 @@
     /**
      * Test exception 500
      * @expectedException        CorpusParole\Services\ViafResolverException
-     * @expectedExceptionMessage Server error: 500
+     * @expectedExceptionMessage Server error: `GET http://viaf.org/viaf/12345/` resulted in a `500 Internal Server Error` response:
      * @expectedExceptionCode 500
      */
     public function test500Error() {