Skip to content
Snippets Groups Projects
Commit 066ea25f authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch...

Merge branch 'hotline#82189_pas_de_mise_a_jour_du_flux_xml_de_la_ressource_numerique_lekiosk_' into 'hotline'

hotline #82189 :  Le kiok : delete non harvesting album and get album id unique

See merge request !2949
parents 04eb193a 8c1c372e
Branches
Tags
4 merge requests!3297WIP: Master,!2952Master,!2951Hotline,!2949hotline #82189 : Le kiok : delete non harvesting album and get album id unique
Pipeline #5904 passed with stage
in 31 minutes and 22 seconds
- ticket #82189 : Connecteur LeKiosk : correction de la mise à jour lors du moissonage
\ No newline at end of file
<?php
$adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
try {
$adapter->query('ALTER TABLE album modify id_origine varchar(255)');
} catch(Exception $e) {}
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
......@@ -120,4 +121,10 @@ class Lekiosk_Service extends Class_DigitalResource_Service {
? $result['token']
: null;
}
protected function _deleteNonHarvested() {
return $this->_deleteNonHarvestedAlbums();
}
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ class Lekiosk_Service_Parser {
$album = new Lekiosk_Service_Album();
$album
->setId($attribs['PUBLICATIONID'])
->setId($attribs['PUBLICATIONID'].':'.$attribs['ISSUENUMBER'])
->setTitle($this->_getTitle($attribs))
->setExternalUri($attribs['SSOURL'])
->setDescription($attribs['ISSUEDESCRIPTION'])
......
......@@ -314,8 +314,8 @@ class LekioskServiceHarvestTest extends LekioskServiceTestCase {
/** @test */
public function nationalSportIdShouldBe851749() {
$this->assertEquals(851749, $this->_10_national_sport->getIdOrigine());
public function nationalSportIdShouldBe851749419() {
$this->assertEquals('851749:419', $this->_10_national_sport->getIdOrigine());
}
/** @test */
......@@ -576,14 +576,59 @@ abstract class LekioskServiceHttpHarvestingTestCase extends AbstractControllerTe
$service = new Lekiosk_Service($config);
$service->harvest();
Class_Album::clearCache();
}
}
class LekioskServiceHttpUpdateHarvestingTest extends LekioskServiceHttpHarvestingTestCase {
public function setUp() {
parent::setUp();
$token_json = file_get_contents(__DIR__. '/token.json');
$http_client = $this->mock()
->whenCalled('postRawData')
->with('https://apipros.lekiosk.com/login',
'{"username":"FOIX","userpwd":"PWD"}','application/json')
->answers($token_json)
->whenCalled('open_url')
->with('https://apipros.lekiosk.com/publications/flow',
['headers' => ['Authorization' => 'JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MjY2MjAxNiwibmFtZSI6Illvbm5lQGdtYWlsLmNvbSIsImV4cCI6MTUxNzM5OTE0M30.qZuwpsrZmk95LU0XYKPBFqpJJ4wxOVyZnJ_Gt3panxw']])
->answers(file_get_contents(__DIR__. '/updated_catalogue_from_http.xml'))
->whenCalled('open_url')
->answers(null);
Lekiosk_Service::setDefaultHttpClient($http_client);
$config = Lekiosk_Config::getInstance();
$config->setTimeSource(new TimeSourceForTest('2019-02-06 10:00:00'));
$service = new Lekiosk_Service($config);
$service->harvest();
Class_Album::clearCache();
}
/** @test */
public function allPreviousAlbumShouldBeDeleted() {
$this->assertCount(2, Class_Album::findAll());
}
/** @test */
public function oneAlbumTitleShouldBe10NationalSport() {
$this->assertEquals('Le 10 Sport National n°440 : 6 décembre 2018', Class_Album::find(4)->getTitre());
}
}
class LekioskServiceHttpHarvestingTest extends LekioskServiceHttpHarvestingTestCase {
/** @test */
public function contextShouldExpectation() {
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -2392,3 +2392,17 @@ class UpgradeDB_360_Test extends UpgradeDBTestCase {
/** @test */
public function placeholderForSigbStandardCodificationsMigration() {}
}
class UpgradeDB_361_Test extends UpgradeDBTestCase {
public function prepare() {
$this->silentQuery('ALTER TABLE album modify id_origine varchar(50)');
}
/** @test */
public function idOrigineLengthShouldBe255() {
$this->assertFieldType('album','id_origine', 'varchar(255)');
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment