diff --git a/library/digital_resources/Skilleos/Service/Parser.php b/library/digital_resources/Skilleos/Service/Parser.php index d787b58dd13e557817b7491ebe2bc53c14caf970..d6c94243d532dd337b9fed0ae8ca37b4e78b2c00 100644 --- a/library/digital_resources/Skilleos/Service/Parser.php +++ b/library/digital_resources/Skilleos/Service/Parser.php @@ -28,7 +28,7 @@ class Skilleos_Service_Parser extends Class_WebService_BibNumerique_RessourceNum ->setDescription($json->introduction.$json->description.$json->contenu_and_objectif); $this->_lessons = []; - $this->_posters[] = $json->ressource->url; + $this->_posters[] = isset($json->picture) ? $json->picture->url : $json->ressource->url; $this->addAuthor($json->teacher->name); diff --git a/library/digital_resources/Skilleos/tests/SkilleosTest.php b/library/digital_resources/Skilleos/tests/SkilleosTest.php index 5208cff5b32c099b3a889f7c1548681f3150ac14..3c78a91fe0741d388c51053b03ededae47a74807 100644 --- a/library/digital_resources/Skilleos/tests/SkilleosTest.php +++ b/library/digital_resources/Skilleos/tests/SkilleosTest.php @@ -281,6 +281,13 @@ class SkilleosServiceHarvestTest extends SkilleosServiceTestCase { $this->assertEquals('Tatiana Abbey', Class_Album::find(6)->getAuthors()[0]->getName()); } + + /** @test */ + public function thumbnailShouldBeThumbDotpng() { + $this->assertEquals('https://moncompte.skilleos.com/uploads/ressources/default/0001/11/thumb_10683_default_big.png', Class_Album::find(6)->getPoster()); + } + + /** @test */ public function withoutUserConnectionLinkToModuleSkilleosShouldIndicateToConnect() { ZendAfi_Auth::getInstance()->clearIdentity(); diff --git a/library/digital_resources/Skilleos/tests/results.json b/library/digital_resources/Skilleos/tests/results.json index b0a6f42ce8282dc8fec3c9a2079344a4d7ebdfa9..a4defa386ec929635b531776cf318c72d6d21804 100644 --- a/library/digital_resources/Skilleos/tests/results.json +++ b/library/digital_resources/Skilleos/tests/results.json @@ -105,7 +105,7 @@ "url": "https:\/\/moncompte.skilleos.com\/uploads\/ressources\/default\/0001\/12\/thumb_11660_default_big.png" }, "id": 677, - "ressource": { + "picture": { "url": "https:\/\/moncompte.skilleos.com\/uploads\/ressources\/default\/0001\/12\/thumb_11659_default_big.png" } },