Skip to content
Snippets Groups Projects
Commit 55d81ed2 authored by Arthur Suzuki's avatar Arthur Suzuki Committed by Ghislain Loas
Browse files

hotline #86991 : Fixes OAI-PMH integration over HTTPS

parent 078bcf2f
3 merge requests!3297WIP: Master,!3047Hotline,!3026hotline #86991 : Fixes OAI-PMH integration over HTTPS
Pipeline #6460 passed with stage
in 34 minutes and 22 seconds
- ticket #86991 : Integration cosmogramme : correction de l'import OAI-PMH en HTTPS
\ No newline at end of file
......@@ -79,7 +79,7 @@ class Class_Cosmogramme_Integration extends Storm_Model_Abstract {
public function isSourceHTTP() {
return (false !== strpos($this->getFichier(), 'http://'));
return preg_match('"^http[s]?://"', $this->getFichier());
}
......
......@@ -309,4 +309,57 @@ class PhaseNoticeDublinCoreDedupeTest extends AbstractPhaseNoticeDublinCoreTestC
public function twoRecordsShouldBeInDB() {
$this->assertCount(2, Class_Notice::findAll());
}
}
class phaseNoticeDublinCoreHttpsTestCase extends PhaseNoticeTestCase {
protected function _prepareFixtures() {
parent::_prepareFixtures();
$settings = ['format' => Class_IntProfilDonnees::FORMAT_DUBLIN_CORE,
'type_fichier' => Class_IntProfilDonnees::FT_RECORDS,
'0_type' => [''],
'0_format' => [''],
'15_type' => ['document cartographique'],
'15_format' => ['image/jpeg',
'image/png'],
'16_type' => ['atlas',
'carte postale',
'carte'],
'16_format' => ['image/jpeg',
'image/png'],
'25_type' => ['atlas'],
'25_format' => ['plan']];
$serialized_settings = (new Class_ProfileSerializer($settings))->serializeDatas();
Class_IntProfilDonnees::find(102)
->setTypeFichier(Class_IntProfilDonnees::FT_RECORDS)
->setFormat(Class_IntProfilDonnees::FORMAT_DUBLIN_CORE)
->setAttributs($serialized_settings)
->save();
$this->fixture('Class_IntBib',
['id' => 3,
'nom_court' => 'BNF Gallica Atlas']);
Class_Cosmogramme_Integration::find(999)
->setIdBib(3)
->setFichier('https://www.lempreinte.valenceromansagglo.fr/oai/oai2.php?verb=ListRecords&metadataPrefix=oai_dc')
->save();
$webclient = $this->mock();
$webclient->whenCalled('open_url')
->with('https://www.lempreinte.valenceromansagglo.fr/oai/oai2.php?verb=ListRecords&metadataPrefix=oai_dc')
->answers(null)->beStrict();
Class_WebService_OAI::setDefaultHttpClient($webclient);
}
/** @test */
public function methodOpenUrlShouldHaveBeenCalledWithHttpsLEmpreinte() {
$this->assertTrue(Class_WebService_OAI::getHttpClient()->methodHasBeenCalledWithParams('open_url',['https://www.lempreinte.valenceromansagglo.fr/oai/oai2.php?verb=ListRecords&metadataPrefix=oai_dc']));
}
}
\ 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