Skip to content
Snippets Groups Projects
Commit 83f8c173 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #50215 wip

parent a2b3fd75
Branches
Tags
5 merge requests!2102#57574 : correction orthographe des jours de la semaine,!2080Sandbox detach zf from storm,!2061Master,!2052Dev#50215 explo st omer henin arques sso avec portail departemental fin moissonnage oai,!2049Dev#50215 explo st omer henin arques sso avec portail departemental fin moissonnage oai
Pipeline #529 failed with stage
in 2 minutes and 55 seconds
...@@ -216,6 +216,12 @@ class Cosmo_DataProfileControllerEditUnimarcKohaTest extends Cosmo_DataProfileCo ...@@ -216,6 +216,12 @@ class Cosmo_DataProfileControllerEditUnimarcKohaTest extends Cosmo_DataProfileCo
} }
/** @test */
public function formatBibliondemandShouldBeAvailable() {
$this->assertXPathContentContains('//form//select[@name="format"]/option[@value="11"]', 'Dublin Core Bibliondemand');
}
/** @test */ /** @test */
public function fieldNouveauteJoursShouldBePresent() { public function fieldNouveauteJoursShouldBePresent() {
$this->assertXPath('//form//input[@id="nouveaute_jours"]'); $this->assertXPath('//form//input[@id="nouveaute_jours"]');
......
...@@ -31,6 +31,7 @@ class Class_Cosmogramme_Integration_Record_DublinCore extends notice_unimarc { ...@@ -31,6 +31,7 @@ class Class_Cosmogramme_Integration_Record_DublinCore extends notice_unimarc {
public function ouvrirNotice($data, $id_data_profile, $sigb, $type_doc_force) { public function ouvrirNotice($data, $id_data_profile, $sigb, $type_doc_force) {
xdebug_break();
$this->_profil = Class_IntProfilDonnees::find($id_data_profile); $this->_profil = Class_IntProfilDonnees::find($id_data_profile);
$this->_types = $data['type']; $this->_types = $data['type'];
$this->_formats = $data['format']; $this->_formats = $data['format'];
......
<?xml version="1.0" encoding="UTF-8"?><OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"><responseDate>2017-02-14T09:28:12Z</responseDate><request verb="ListRecords">oai.bibliondemand.com/oaiserver.ashx</request><ListRecords><record><header><identifier>CG62_5532b9e4e47a7d41fe81d125d3ba7863</identifier><datestamp>2016-12-23T08:42:33Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://music.1dtouch.com/users/auth/assa?dest=albums/137962&amp;bibid=CG62</dc:identifier><dc:identifier>Vignette : http://play-assets-production.1dtouch.com/cargo/medium_8017297007164.jpg</dc:identifier><dc:title>Piero Soffici Quartet</dc:title><dc:type>Document sonore</dc:type><dc:creator>Piero Soffici Quartet</dc:creator><dc:source>1DTOUCH</dc:source><dc:publisher /></oai_dc:dc></metadata></record><record><header><identifier>CG62_516fbc7cfe8fe5e7b6a3c5577b9894dc</identifier><datestamp>2016-12-23T08:42:33Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://music.1dtouch.com/users/auth/assa?dest=albums/109814&amp;bibid=CG62</dc:identifier><dc:identifier>Vignette : http://play-assets-production.1dtouch.com/cargo/medium_5051142090607.jpg</dc:identifier><dc:title>Island Row</dc:title><dc:type>Document sonore</dc:type><dc:creator>Capitol K</dc:creator><dc:source>1DTOUCH</dc:source><dc:publisher /></oai_dc:dc></metadata></record><record><header><identifier>CG62_0856eef7ca0440685bd51ac04d5258ab</identifier><datestamp>2016-12-23T08:42:33Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://music.1dtouch.com/users/auth/assa?dest=albums/121552&amp;bibid=CG62</dc:identifier><dc:identifier>Vignette : http://play-assets-production.1dtouch.com/cargo/medium_3614970852384.jpg</dc:identifier><dc:title>Tunos de Compostela</dc:title><dc:type>Document sonore</dc:type><dc:creator>Tunos De Compostela</dc:creator><dc:source>1DTOUCH</dc:source><dc:publisher /></oai_dc:dc></metadata></record><record><header><identifier>CG62_432ebd04ac7e70f70ecb65a34ad86a79</identifier><datestamp>2016-12-23T08:42:33Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://music.1dtouch.com/users/auth/assa?dest=albums/20206&amp;bibid=CG62</dc:identifier><dc:identifier>Vignette : http://play-assets-production.1dtouch.com/cargo/medium_3700738801098.jpg</dc:identifier><dc:title>Fantasy Classic, No. 1: Atmosphere Synthetic Harpsichord</dc:title><dc:type>Document sonore</dc:type><dc:creator>Christian Levitan</dc:creator><dc:source>1DTOUCH</dc:source><dc:publisher>LEVITAN</dc:publisher></oai_dc:dc></metadata></record><record><header><identifier>CG62_0925032</identifier><datestamp>2017-02-09T07:44:56Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://media.citedelamusique.fr/medias/logon/62-pasdecalais-md?backUrl=http://media.citedelamusique.fr/medias/doc/EXTRANET/CIMU/0925032/DETAIL</dc:identifier><dc:identifier>Vignette : http://media.citedelamusique.fr/images/DocThumbs/CMVI000139300.jpg</dc:identifier><dc:title>We Want Miles. Birth of the Cool Suite</dc:title><dc:type>Document vidéo</dc:type><dc:creator>Joe Lovano</dc:creator><dc:creator>Ralph Lalama</dc:creator><dc:creator>Steve Slagle</dc:creator><dc:creator>Gary Smulyan</dc:creator><dc:creator>Larry Farrell</dc:creator><dc:creator>Barry Ries</dc:creator><dc:creator>James Weidman</dc:creator><dc:creator>Cameron Brown</dc:creator><dc:creator>Lewis Nash</dc:creator><dc:creator>Joe Lovano Nonet</dc:creator><dc:subject>Jazz</dc:subject><dc:source>CIMU</dc:source><dc:publisher>Cité de la musique</dc:publisher></oai_dc:dc></metadata></record><record><header><identifier>CG62_0980101</identifier><datestamp>2017-02-09T07:44:56Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://media.citedelamusique.fr/medias/logon/62-pasdecalais-md?backUrl=http://media.citedelamusique.fr/medias/doc/EXTRANET/CIMU/0980101/DETAIL</dc:identifier><dc:identifier>Vignette : http://media.citedelamusique.fr/images/DocThumbs/CMVI000020202_02.jpg</dc:identifier><dc:title>Musiques pour harpes et pluriarc des Fang du Gabon</dc:title><dc:type>Document vidéo</dc:type><dc:subject>Musiques traditionnelles</dc:subject><dc:source>CIMU</dc:source><dc:publisher>Cité de la musique</dc:publisher></oai_dc:dc></metadata></record><record><header><identifier>CG62_0935471</identifier><datestamp>2017-02-09T07:44:56Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://media.citedelamusique.fr/medias/logon/62-pasdecalais-md?backUrl=http://media.citedelamusique.fr/medias/doc/EXTRANET/CIMU/0935471/DETAIL</dc:identifier><dc:identifier>Vignette : http://media.citedelamusique.fr/images/DocThumbs/CMVI000144001_02.jpg</dc:identifier><dc:title>Salve Regina, cantate en la majeur pour mezzo-soprano et cordes</dc:title><dc:type>Document vidéo</dc:type><dc:creator>Johann Adolf Hasse</dc:creator><dc:creator>Bernarda Fink</dc:creator><dc:creator>Berliner Barock Solisten</dc:creator><dc:subject>Musique baroque</dc:subject><dc:source>CIMU</dc:source><dc:publisher>Cité de la musique</dc:publisher></oai_dc:dc></metadata></record><record><header><identifier>CG62_804</identifier><datestamp>2017-02-09T07:45:32Z</datestamp></header><metadata><oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier>Url : http://www.mediatheque-numerique.com/films/situation-of-the-street</dc:identifier><dc:identifier>Vignette : http://media.universcine.com/34/3d/343d4726-7c56-11de-85a1-871b2e208cb2.jpg</dc:identifier><dc:title>Situation of the street</dc:title><dc:type>Document vidéo</dc:type><dc:creator>Gogola, Jan (Réalisateur)</dc:creator><dc:contributor>Holubová, Eva (Acteur)</dc:contributor><dc:contributor>Pollert, Lukáš (Acteur)</dc:contributor><dc:contributor>Stivínová, Zuzana (Acteur)</dc:contributor><dc:contributor>Marek, Petr (Acteur)</dc:contributor><dc:contributor>Saudek, Jan (Acteur)</dc:contributor><dc:contributor>Sobota, Luděk (Acteur)</dc:contributor><dc:contributor>Kratochvílová, Jana (Acteur)</dc:contributor><dc:contributor>Krejčík, Jiří (Acteur)</dc:contributor><dc:contributor>Dušek, Jaroslav (Acteur)</dc:contributor><dc:subject>Allégorie</dc:subject><dc:subject>Documentaire</dc:subject><dc:subject>Documentaire</dc:subject><dc:subject>Documentaire</dc:subject><dc:subject>Engagé</dc:subject><dc:subject>Etrange</dc:subject><dc:subject>Historique</dc:subject><dc:subject>Politique</dc:subject><dc:subject>Politique</dc:subject><dc:subject>Ville</dc:subject><dc:source>MEDIATHEQUE_NUMERIQUE</dc:source><dc:language>czech</dc:language><dc:description>A travers l'histoire de la célèbre rue Nationale (Národní třída), à Prague, un témoignage historique, radical et polémique, capté ici et maintenant, sur la nation Tchèque. Charlot et Hitler en témoins alors qu'une fille nue comme un fantôme fend la foule en courant... Un documentaire mariant une approche expérimentale et le questionnement politique du monde. Sous-titre du film : "La mer Tchèque prise dans 18 tsunamis"</dc:description></oai_dc:dc></metadata></record></ListRecords></OAI-PMH>
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once('cosmogramme/php/fonctions/variables.php');
require_once(__DIR__.'/PhaseNoticeTestCase.php');
abstract class AbstractRecordPhaseBibliondemandTestCase extends PhaseNoticeTestCase {
protected $_storm_default_to_volatile = true;
protected function _prepareFixtures() {
parent::_prepareFixtures();
Class_TypeDoc::newInstanceWithId(15,
['label' => 'Film']);
Class_TypeDoc::newInstanceWithId(16,
['label' => 'Sonore']);
$settings = ['format' => Class_IntProfilDonnees::FORMAT_BIBLIONDEMAND,
'type_fichier' => Class_IntProfilDonnees::FT_RECORDS,
'0_type' => [''],
'0_format' => [''],
'15_type' => ['Document vidéo'],
'15_format' => [''],
'16_type' => ['Document sonore'],
'16_format' => [''],];
$serialized_settings = (new Class_ProfileSerializer($settings))->serializeDatas();
Class_IntProfilDonnees::find(102)
->setTypeFichier(Class_IntProfilDonnees::FT_RECORDS)
->setFormat(Class_IntProfilDonnees::FORMAT_BIBLIONDEMAND)
->setAttributs($serialized_settings)
->save();
$this->fixture('Class_IntBib',
['id' => 3,
'nom_court' => 'Bibliondemand']);
Class_Cosmogramme_Integration::find(999)
->setIdBib(3)
->setFichier('http://oai.bibliondemand.com/oaiserver.ashx?verb=ListRecords&metadataPrefix=oai_dc&set=CG62')
->save();
$xml = file_get_contents(__DIR__.'/Bibliondemand.xml');
$webclient = $this->mock();
$webclient->whenCalled('open_url')
->with('http://oai.bibliondemand.com/oaiserver.ashx?verb=ListRecords&metadataPrefix=oai_dc&set=CG62')
->answers($xml)
->beStrict();
Class_WebService_OAI::setDefaultHttpClient($webclient);
}
public function tearDown() {
Class_WebService_OAI::setDefaultHttpClient(null);
parent::tearDown();
}
}
class RecordPhaseBibliondemandSimpleTest extends AbstractRecordPhaseBibliondemandTestCase {
/** @test */
public function logShouldNotContainsError() {
$this->assertNotLogContains('Erreur');
}
/** @test */
public function totalNumberOfRecordsFromOAIShouldBeEight() {
$this->assertEquals(8, Class_Notice::count());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordTitleShoudBeCittaFortezzeIisole() {
$this->assertContains('Citta, fortezze, isole', Class_Notice::find(1)->getTitrePrincipal());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordAuthorShouldBeCoronelli() {
$this->assertEquals('Coronelli, Vincenzo Maria (1650-1718). Cartographe',
Class_Notice::find(1)->getAuteurPrincipal());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordShouldHave5Notes() {
$this->assertCount(5, Class_Notice::find(1)->getNotes());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordShouldHaveOneItem() {
$this->assertCount(1, Class_Notice::find(1)->getExemplaires());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordDocTypeShouldBeShouldPlan() {
$this->assertEquals('plan', Class_Notice::find(1)->getTypeDocLabel());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordItemBarcodeShouldBeAnMD5SumOfUrl() {
$item = Class_Notice::find(1)->getExemplaires()[0];
$this->assertEquals('db0b7eded86da6efa8ee0c980b9d081a', $item->getCodeBarres());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordItemLibraryShouldBeBNFGallicaAtlas() {
$item = Class_Notice::find(1)->getExemplaires()[0];
$this->assertEquals('BNF Gallica Atlas', $item->getIntBib()->getNomCourt());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function lastRecordDocTypeShouldBeShouldAtlas() {
$this->assertEquals('atlas', Class_Notice::find(9)->getTypeDocLabel());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordResumeShoudContainsEchellesDiverses() {
$this->assertContains('[Échelles diverses]', Class_Notice::find(1)->getResume());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function unimarcWithItemsShouldContainsDoctype() {
$item = Class_Notice::find(1)->getExemplaires()[0];
$this->assertContains('s:1:"r";s:6:"valeur";s:74:"cartographic resource;document cartographique;image fixe;image;still image";', $item->getZone995());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function firstRecordItemUrlShouldBeGallicaArcOai() {
$item = Class_Notice::find(1)->getExemplaires()[0];
$this->assertEquals('http://gallica.bnf.fr/ark:/12148/btv1b55006135m', $item->getUrl());
}
/**
* @test
* @depends totalNumberOfRecordsFromOAIShouldBeNine
*/
public function recordWithAtlasPlanDoctypeShouldBePresent() {
$this->assertNotNull(Class_Notice::findFirstBy(['type_doc' => 25]));
}
}
class PhaseNoticeDublinCoreUpdateTest extends AbstractRecordPhaseBibliondemandTestCase {
public function _prepareFixtures() {
parent::_prepareFixtures();
Class_Cosmogramme_Integration::find(999)
->beIncrementImport()
->save();
$record = $this->fixture('Class_Notice',
['id' => 1,
'type_doc' => 15,
'alpha_titre' => 'CITTA FORTEZZE ISOLE E PORTI PRINCIPALI DELL EUROPA IN PLANTA ET IN ELEVATIONE DESCRITTE E PUBLICATE AD USO DELL ACCADEMIA COSMOGRAFICA DEGLI ARGONAUTI DAL PADRE MAESTRO CORONELLI',
'facettes' => 'T15',
'clef_alpha' => 'CITTAFORTEZZEISOLEEPORTIPRINCIPALIDELLEUROPAINPLANTAETINELEVATIONEDESCRIT-----1689-15',
'clef_oeuvre' => 'CITTAFORTEZZEISOLEEPORTIPRINCIPALIDELLEUROPAINPLANTAETINELEVATIONEDESCRIT---',
'annee' => '1689',
'unimarc' => '',
'qualite' => 0,
'exportable' => true,
'date_maj' => '2016-04-25 14:39:58',
'url_vignette' => 'http://gallica.bnf.fr/ark:/12148/btv1b55006135m.thumbnail',
'url_image' => 'http://gallica.bnf.fr/ark:/12148/btv1b55006135m/f1.highres',
'exemplaires' => [
$this->fixture('Class_Exemplaire',
['id' => 1,
'activite' => 'peut être prêté',
'zone995' => 'a:2:{i:0;a:2:{s:4:"code";s:1:"f";s:6:"valeur";s:32:"db0b7eded86da6efa8ee0c980b9d081a";}i:1;a:2:{s:4:"code";s:1:"r";s:6:"valeur";s:44:"document cartographique manuscrit;image fixe";}}',
'code_barres' => 'db0b7eded86da6efa8ee0c980b9d081a',
'id_bib' => 3,
'id_int_bib' => 3])
]]);
}
public function setUp() {
parent::setUp();
$this->_record = Class_Notice::find(1);
}
/** @test */
public function recordShouldNotBeDeleted() {
$this->assertNotEmpty($this->_record);
}
/** @test */
public function typeDocShouldStay15() {
$this->assertEquals(15, $this->_record->getTypeDoc());
}
/** @test */
public function recordShouldHaveOnlyOneItem() {
$this->assertEquals(1, count(Class_Exemplaire::findAllBy(['id_notice' => 1])));
}
}
class PhaseNoticeDublinCoreDedupeTest extends AbstractRecordPhaseBibliondemandTestCase {
protected function _prepareFixtures() {
parent::_prepareFixtures();
Class_CosmoVar::newInstanceWithId('mode_doublon',
['valeur' => 1]);
$xml = file_get_contents(__DIR__. '/dublinCoreDedup.xml');
$webclient = $this->mock();
$webclient->whenCalled('open_url')
->with('http://oai.bnf.fr/oai2/OAIHandler?verb=ListRecords&metadataPrefix=oai_dc&set=gallica%3Atypedoc%3Acartes%3Aatlas')
->answers($xml)
->beStrict();
Class_WebService_OAI::setDefaultHttpClient($webclient);
}
/** @test */
public function logShouldNotContainsError() {
$this->assertNotLogContains('Erreur');
}
/** @test */
public function twoRecordsShouldBeInDB() {
$this->assertCount(2, Class_Notice::findAll());
}
}
\ 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