diff --git a/FEATURES/91508 b/FEATURES/91508 new file mode 100644 index 0000000000000000000000000000000000000000..6fa7db66801b86d478b62a398c9748dbec1e22f2 --- /dev/null +++ b/FEATURES/91508 @@ -0,0 +1,10 @@ + '91508' => + ['Label' => $this->_('Pagination de la récupération des prêts pour le SIGB Koha'), + 'Desc' => 'SIGB Koha : Création d'une variable Cosmogramme pour permettre la récupération des prêts par lots (disponible à partir de Koha 18.11.09)', + 'Image' => '', + 'Video' => '', + 'Category' => '', + 'Right' => function($feature_description, $user) {return true;}, + 'Wiki' => 'http://wiki.bokeh-library-portal.org/index.php?title=SIGB_Koha', + 'Test' => '', + 'Date' => '2019-09-06'], \ No newline at end of file diff --git a/VERSIONS_WIP/91508 b/VERSIONS_WIP/91508 new file mode 100644 index 0000000000000000000000000000000000000000..b3c0d11e8c25d54c84dac5271bffb90d9caba0fa --- /dev/null +++ b/VERSIONS_WIP/91508 @@ -0,0 +1 @@ + - ticket #91508 : SIGB Koha - Création d'une variable cosmogramme permettant de limiter le nombre de prêts récupérées en une seule requète. \ No newline at end of file diff --git a/application/modules/telephone/views/scripts/auth/boitelogin.phtml b/application/modules/telephone/views/scripts/auth/boitelogin.phtml index 9a05b1b3169a0d6c3429b08ed71410c92ccf87bd..1bbde9f60ec54b536417cac2a113483ddd91cc41 100644 --- a/application/modules/telephone/views/scripts/auth/boitelogin.phtml +++ b/application/modules/telephone/views/scripts/auth/boitelogin.phtml @@ -11,7 +11,7 @@ if($user = Class_Users::getLoader()->getIdentity()) { ); if ($user->hasIdabon()) - echo impldoe($this->ficheAbonneLinks($user->getNbEmprunts(), + echo implode($this->ficheAbonneLinks($user->getNbEmprunts(), $user->getNbEmpruntsRetard(), $user->getNbReservations())); diff --git a/cosmogramme/php/fonctions/objets_saisie.php b/cosmogramme/php/fonctions/objets_saisie.php index 75ef019d26eeba3f5721a93f04c238cfcd876885..bf55c80338cdadd95d8deb579efc9a6610374695 100644 --- a/cosmogramme/php/fonctions/objets_saisie.php +++ b/cosmogramme/php/fonctions/objets_saisie.php @@ -132,6 +132,7 @@ function getBlocsParams($id_bib, $type, $valeurs) { }], 'Interdire_reservation_doc_dispo', 'use_card_number', + 'loans_per_page', ['Codification_disponibilites' => function($id, $valeur){ return getTextArea($id, $valeur, 30, 20); }], diff --git a/library/Class/User/Cards.php b/library/Class/User/Cards.php index 8e28acf9599a198aa0a5316f1622002caedd7361..3aba1e02f146946fd4e9e6da65736283b8f61e18 100644 --- a/library/Class/User/Cards.php +++ b/library/Class/User/Cards.php @@ -81,6 +81,14 @@ class Class_User_Cards extends Storm_Model_Collection { } + public function hasPagedLoans() { + return null !== $this->detect(function($card) + { + return $card->hasPagedLoans(); + }); + } + + public function getLoansCount() { return $this->getLoans()->count(); } @@ -144,4 +152,15 @@ class Class_User_Cards extends Storm_Model_Collection { return $operations; } + + + public function registerNotificationsOn($notifiable) { + $this->eachDo(function($card) use ($notifiable) + { + if (!$card->hasPagedLoans()) + (new Class_User_ILSSubscription($card))->registerNotificationsOn($notifiable); + }); + + return $this; + } } \ No newline at end of file diff --git a/library/Class/Users.php b/library/Class/Users.php index baf49c9b792de556ac3843455595031227ba2368..cb814bed869827e2596b14f04b9d80d6758496af 100644 --- a/library/Class/Users.php +++ b/library/Class/Users.php @@ -1161,6 +1161,7 @@ class Class_Users extends Storm_Model_Abstract { } + public function providesLoansHistory() { if($this->getLoader()->isCurrentUserAllowedToEditProfile(Class_Profil::getCurrentProfil())) return true; @@ -1205,12 +1206,27 @@ class Class_Users extends Storm_Model_Abstract { } + public function hasPagedLoans() { + if (!($emprunteur = $this->getEmprunteur())) + return false; + + $emprunteur->ensureService($this); + + return $emprunteur->hasLoansPerPage(); + } + + public function hasPNB() { return 0 < count($this->getPNBLoans()); } public function getLoansWithOutPNB($params = []) { + $reload_all_pages = (isset($params['pages']) && $params['pages'] == 'all'); + + if($this->hasPagedLoans() && !$reload_all_pages) + return (new Class_User_Loans()); + return $this->getEmprunts()->withoutPNB($params); } @@ -1702,16 +1718,12 @@ class Class_Users extends Storm_Model_Abstract { public function registerNotificationsOn($notifiable) { - $cards = new Class_User_Cards($this); - - foreach($cards as $card) - (new Class_User_ILSSubscription($card))->registerNotificationsOn($notifiable); - + $cards = (new Class_User_Cards($this))->registerNotificationsOn($notifiable); (new Class_User_CardsNotification($this))->registerNotificationsOn($notifiable); $this ->_notifyOn($notifiable, - $late_loans_count = $cards->getLateLoansCount(), + !$cards->hasPagedLoans() && ($late_loans_count = $cards->getLateLoansCount()), $this->_plural($late_loans_count, '', 'Vous avez %d document en retard.', diff --git a/library/Class/WebService/SIGB/AbstractRESTService.php b/library/Class/WebService/SIGB/AbstractRESTService.php index 5edca9ed30d4d9212f121dd7abe7f9270ae934b6..7af83b0522e6ab1d02513ba9bfdc93e9724f3b7c 100644 --- a/library/Class/WebService/SIGB/AbstractRESTService.php +++ b/library/Class/WebService/SIGB/AbstractRESTService.php @@ -205,6 +205,22 @@ abstract class Class_WebService_SIGB_AbstractRESTService extends Class_WebServic } + public function ilsdiGetLoansPage($params, $reader, $error_tag='error') { + $params = array_merge(array('service' => 'GetPatronInfo'), $params); + $xml = $this->httpGet($params); + + if (0 === strpos($xml, '<html>')) + return $emprunteur; + + if ($this->_getTagData($xml, $error_tag)) + return $emprunteur; + + return $reader + ->setEmprunteur(Class_WebService_SIGB_Emprunteur::nullInstance()) + ->parseXML($xml); + } + + /** * @param array $params * @return array diff --git a/library/Class/WebService/SIGB/AbstractService.php b/library/Class/WebService/SIGB/AbstractService.php index dd2a4bf2d495aa2b80a0433bfa4cb2fc487f0282..9f30e2550640197588d6a25b6b27a9ca48996895 100644 --- a/library/Class/WebService/SIGB/AbstractService.php +++ b/library/Class/WebService/SIGB/AbstractService.php @@ -149,6 +149,11 @@ abstract class Class_WebService_SIGB_AbstractService { } + public function providesPagedLoans() { + return false; + } + + protected function _success() { return ['statut' => true, 'erreur' => '']; } diff --git a/library/Class/WebService/SIGB/Emprunteur.php b/library/Class/WebService/SIGB/Emprunteur.php index 1ec05f5b159b825a1c921ae67d2f4df2f236a64a..14692b5f2209f5a4d83ed4004de85be9eee4d91f 100644 --- a/library/Class/WebService/SIGB/Emprunteur.php +++ b/library/Class/WebService/SIGB/Emprunteur.php @@ -54,7 +54,9 @@ class Class_WebService_SIGB_Emprunteur { public function __sleep() { - $this->getEmprunts(); + if (!$this->hasLoansPerPage()) + $this->getEmprunts(); + $this->getReservations(); return ['_id', '_name', @@ -476,6 +478,20 @@ class Class_WebService_SIGB_Emprunteur { } + public function hasLoansPerPage() { + if(!isset($this->_service)) + return false; + + if(!$this->_service->providesPagedLoans()) + return false; + + if(0 < $this->_service->getLoansPerPage()) + return true; + + return false; + } + + public function getEmprunts() { if (!empty($this->_emprunts)) return $this->_emprunts; @@ -488,6 +504,7 @@ class Class_WebService_SIGB_Emprunteur { } + /** * @param int $index * @return Class_WebService_SIGB_Emprunt diff --git a/library/Class/WebService/SIGB/Koha.php b/library/Class/WebService/SIGB/Koha.php index d14d4defb6f486dd84354b101a7bddfa856fdcbb..83ec98e625a6937a69a93e79e13bdc07634b77e3 100644 --- a/library/Class/WebService/SIGB/Koha.php +++ b/library/Class/WebService/SIGB/Koha.php @@ -35,6 +35,7 @@ class Class_WebService_SIGB_Koha { 'restful' => '', 'pre-registration' => '', 'use_card_number' => '', + 'loans_per_page' => 0, 'withdrawn_mapping' => '', 'grouped_holds_itypes' => '', 'bundled_holds_minimal_duration' => 0, diff --git a/library/Class/WebService/SIGB/Koha/LoansPageReader.php b/library/Class/WebService/SIGB/Koha/LoansPageReader.php new file mode 100644 index 0000000000000000000000000000000000000000..1c041690f00e613b25061f5c725834f34b066749 --- /dev/null +++ b/library/Class/WebService/SIGB/Koha/LoansPageReader.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright (c) 2012, 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 + */ + +class Class_WebService_SIGB_Koha_LoansPageReader + extends Class_WebService_SIGB_Koha_PatronInfoReader { + + protected + $_loans = [], + $_total = 0; + + + public static function newInstance() { + return new self(); + } + + + public function endLoans() { + //intentionnaly do nothing + } + + + public function endLoan() { + $this->_loans [] = $this->_currentLoan; + } + + + public function endTotal_Loans($data) { + $this->_total = ((int)$data); + } + + + public function getTotal() { + return $this->_total; + } + + + public function getLoans() { + return $this->_loans; + } +} diff --git a/library/Class/WebService/SIGB/Koha/PatronInfoReader.php b/library/Class/WebService/SIGB/Koha/PatronInfoReader.php index a841c99fa855ba79269befdfefccc21781b359ae..d7c2f84da8288d4f9b8ac62fc9a5d6714c6e6991 100644 --- a/library/Class/WebService/SIGB/Koha/PatronInfoReader.php +++ b/library/Class/WebService/SIGB/Koha/PatronInfoReader.php @@ -174,6 +174,11 @@ class Class_WebService_SIGB_Koha_PatronInfoReader extends Class_WebService_SIGB_ if ($this->_xml_parser->inParents('hold')) $this->_currentHold->setIType($data); } + + + public function endTotal_Loans($data) { + $this->getEmprunteur()->setNbEmprunts((int)$data); + } } ?> \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Koha/Service.php b/library/Class/WebService/SIGB/Koha/Service.php index 951825747e2da80fb7a440b55e0114b4e3389337..24392e14aafe73aa36a60edd2917577fce43b94b 100644 --- a/library/Class/WebService/SIGB/Koha/Service.php +++ b/library/Class/WebService/SIGB/Koha/Service.php @@ -26,6 +26,7 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR $interdire_resa_doc_dispo = false, $restful = false, $codification_disponibilites = [], + $loans_per_page = 0, $_withdrawn_mapping = [], $_grouped_holds_itypes = [], $_bundled_holds_minimal_duration = 0, @@ -41,7 +42,8 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR ->setServerRoot($params['url_serveur']) ->setInterdireResaDocDispo($params['Interdire_reservation_doc_dispo']==='1') ->setRestful($params['restful']==='1') - ->setPreRegistration($params['pre-registration'] === '1'); + ->setPreRegistration($params['pre-registration'] === '1') + ->setLoansPerPage($params['loans_per_page']); } @@ -132,10 +134,48 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR } + public function setLoansPerPage($loans_per_page) { + $this->loans_per_page = $loans_per_page; + return $this; + } + + + public function getLoansPerPage() { + return $this->loans_per_page; + } + + + + public function getEmpruntsOf($emprunteur) { + $loans_page = 1; + $loans = new Storm_Collection(); + + do { + $page_params = $this->loans_per_page + ? ['loans_per_page' => $this->loans_per_page, + 'loans_page' => $loans_page] + : []; + + $params = array_merge(['patron_id' => $emprunteur->getId(), + 'show_contact' => 0, + 'show_loans' => 1, + 'show_holds' => 0 ], + $page_params); + + $reader = $this->ilsdiGetLoansPage($params, + Class_WebService_SIGB_Koha_LoansPageReader::newInstance()); + $loans_page ++; + $loans->addAll($reader->getLoans()); + } while ($reader->getTotal() > $loans->count()); + + return $loans->getArrayCopy(); + } + + protected function getEmprunteurFor($patron_id) { return $this->ilsdiGetPatronInfo(['patron_id' => $patron_id, 'show_contact' => 1, - 'show_loans' => 1, + 'show_loans' => 0, 'show_holds' => 1], Class_WebService_SIGB_Koha_PatronInfoReader::newInstance() ->setGroupedHoldsITypes($this->_grouped_holds_itypes)); @@ -330,6 +370,11 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR } + public function providesPagedLoans() { + return $this; + } + + public function providePreRegistration() { return $this->pre_registration; } diff --git a/library/ZendAfi/View/Helper/Abonne/Prets.php b/library/ZendAfi/View/Helper/Abonne/Prets.php index 4eed0453c65b4a8cbcd7625d103d0ad10019d64d..9031343d87baa25342b073b712e231daceec354c 100644 --- a/library/ZendAfi/View/Helper/Abonne/Prets.php +++ b/library/ZendAfi/View/Helper/Abonne/Prets.php @@ -25,13 +25,18 @@ class ZendAfi_View_Helper_Abonne_Prets extends ZendAfi_View_Helper_Abonne_Abstra if ($cards->isEmpty() && (!$user->isAdmin())) return ''; - $nb_prets = $cards->getLoans()->count(); + if ($cards->hasPagedLoans()) + return $this->_renderPaged($user); + + $nb_prets = $cards->getLoansCount(); + $str_prets = $this->view->_plural($nb_prets, "Vous n'avez aucun prêt en cours.", "Vous avez %d prêt en cours", "Vous avez %d prêts en cours", $nb_prets); + $nb_retards = $cards->getLateLoans()->count(); $str_retards = $nb_retards ? $this->_('(%d en retard)', $nb_retards) @@ -54,6 +59,25 @@ class ZendAfi_View_Helper_Abonne_Prets extends ZendAfi_View_Helper_Abonne_Abstra 'prets', $action_prets_url); } -} -?> + protected function _renderPaged($user) { + $str_prets = $this->view->_('Voir tous mes prêts'); + $action_prets_url = $this->view->url(['controller' => 'abonne', + 'action' => 'prets', + 'pages' => 'all']); + + $action_history_url = $this->view->url(['controller' => 'abonne', + 'action' => 'loans-history']); + + $history_link = $user->providesLoansHistory() + ? '<br/><br/>' . $this->_tag('a', $this->_('Voir mon historique de prêts'), + ['href' => $action_history_url]) + : ''; + + return $this->tagFicheAbonne($this->_tag('a', $str_prets, + ['href' => $action_prets_url]) + . $history_link, + 'prets', + $action_prets_url); + } +} diff --git a/library/ZendAfi/View/Helper/Widget/Login.php b/library/ZendAfi/View/Helper/Widget/Login.php index 1508361b907aa9305a67bb4240b066fac14d154c..a22551ad31037605d0f812c566813c0da06cde0d 100644 --- a/library/ZendAfi/View/Helper/Widget/Login.php +++ b/library/ZendAfi/View/Helper/Widget/Login.php @@ -45,11 +45,18 @@ class ZendAfi_View_Helper_Widget_Login extends ZendAfi_View_Helper_BaseHelper { $html [] = $this->view->renderNotifications($user); $cards = new Class_User_Cards($user); - if (!$cards->isEmpty()) - $html = array_merge($html, - $this->view->ficheAbonneLinks($cards->getLoansCount(), - $cards->getLateLoansCount(), - $cards->getHoldsCount())); + if (!$cards->isEmpty()) { + $loans = $cards->hasPagedLoans() + ? [$this->view->tagAnchor(['controller' => 'abonne', + 'action' => 'prets', + 'pages' => 'all'], + $this->view->_('Voir tous mes prêts'), + ['class' => 'account-loans'])] + : $this->view->ficheAbonneLinks($cards->getLoansCount(), + $cards->getLateLoansCount(), + $cards->getHoldsCount()); + $html = array_merge($html,$loans); + } $html [] = $this->_tag('a', $preferences['lien_deconnection'], ['title' => $this->_('Se déconnecter de la session %s', $user->getNomComplet()), diff --git a/library/templates/Intonation/Library/Widget/Login/View.php b/library/templates/Intonation/Library/Widget/Login/View.php index 4d0a713b3a3f239e3ca8bc81995c01e23232c422..25f475ac92f197ec9fee9a9006dd3428e42361bb 100644 --- a/library/templates/Intonation/Library/Widget/Login/View.php +++ b/library/templates/Intonation/Library/Widget/Login/View.php @@ -194,11 +194,18 @@ class IntonationLoginRenderDefault extends IntonationLoginRenderAbstract { 'class' => 'account-link'])]; $cards = new Class_User_Cards($user); - if (!$cards->isEmpty()) - $links = array_merge($links, - $this->_view->ficheAbonneLinks($cards->getLoansCount(), - $cards->getLateLoansCount(), - $cards->getHoldsCount())); + if (!$cards->isEmpty()) { + $loans = $cards->hasPagedLoans() + ? [$this->_view->tagAnchor(['controller' => 'abonne', + 'action' => 'prets', + 'pages' => 'all'], + $this->view->_('Voir tous mes prêts'), + ['class' => 'account-loans'])] + : $this->_view->ficheAbonneLinks($cards->getLoansCount(), + $cards->getLateLoansCount(), + $cards->getHoldsCount()); + $links = array_merge($links,$loans); + } if($notifications = $this->_view->renderNotifications($user)) $links = array_merge($links, $notifications); @@ -252,11 +259,18 @@ class IntonationLoginRenderInline extends IntonationLoginRenderAbstract { null, true)))]; $cards = new Class_User_Cards($user); - if (!$cards->isEmpty()) - $links = array_merge($links, - $this->_view->ficheAbonneLinks($cards->getLoansCount(), - $cards->getLateLoansCount(), - $cards->getHoldsCount())); + if (!$cards->isEmpty()) { + $loans = $cards->hasPagedLoans() + ? [$this->_view->tagAnchor(['controller' => 'abonne', + 'action' => 'prets', + 'pages' => 'all'], + $this->view->_('Voir tous mes prêts'), + ['class' => 'account-loans'])] + : $this->_view->ficheAbonneLinks($cards->getLoansCount(), + $cards->getLateLoansCount(), + $cards->getHoldsCount()); + $links = array_merge($links,$loans); + } if($notifications = $this->_view->renderNotifications($user)) $links = array_merge($links, $notifications); @@ -313,19 +327,26 @@ class IntonationLoginRenderToggle extends IntonationLoginRenderAbstract { 'class' => 'btn btn-sm btn-primary'])), $this->_view->tagAction((new Intonation_Library_Link()) - ->setText($this->_settings->getLienDeconnection()) - ->setAttribs(['class' => 'btn btn-sm btn-secondary', - 'title' => $this->_('Se déconnecter de la session %s', $this->_user->getNomComplet())]) - ->setUrl($this->_view->url(['controller'=>'auth', - 'action'=>'logout'], - null, true)))]; + ->setText($this->_settings->getLienDeconnection()) + ->setAttribs(['class' => 'btn btn-sm btn-secondary', + 'title' => $this->_('Se déconnecter de la session %s', $this->_user->getNomComplet())]) + ->setUrl($this->_view->url(['controller'=>'auth', + 'action'=>'logout'], + null, true)))]; $cards = new Class_User_Cards($this->_user); - if (!$cards->isEmpty()) - $links = array_merge($links, - $this->_view->ficheAbonneLinks($cards->getLoansCount(), - $cards->getLateLoansCount(), - $cards->getHoldsCount())); + if (!$cards->isEmpty()) { + $loans = $cards->hasPagedLoans() + ? [$this->_view->tagAnchor(['controller' => 'abonne', + 'action' => 'prets', + 'pages' => 'all'], + $this->view->_('Voir tous mes prêts'), + ['class' => 'account-loans'])] + : $this->_view->ficheAbonneLinks($cards->getLoansCount(), + $cards->getLateLoansCount(), + $cards->getHoldsCount()); + $links = array_merge($links,$loans); + } if($notifications = $this->_view->renderNotifications($this->_user)) $links = array_merge($links, $notifications); @@ -337,9 +358,9 @@ class IntonationLoginRenderToggle extends IntonationLoginRenderAbstract { }, $links); $html = $this->_view->tag('div', - $this->_view->tag('ul', - implode($links), - $this->_getLinksListAttribs()), + $this->_view->tag('ul', + implode($links), + $this->_getLinksListAttribs()), ['class' => 'align-self-center']); return $this->_view->renderDropdown($html, diff --git a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php index 63be51b750b03d0d4fbd2d3abc34ba67bc52f1c8..3e5ebb3432ff6228b0ec19c285d8883f980b97bd 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php @@ -21,6 +21,7 @@ require_once 'tests/fixtures/DilicomFixtures.php'; require_once 'tests/fixtures/NanookFixtures.php'; +require_once 'tests/fixtures/KohaFixtures.php'; abstract class AbstractAbonneControllerPretsTestCase extends AbstractControllerTestCase { protected @@ -276,6 +277,70 @@ class AbonneControllerPretsExportThreePretsTest extends AbonneControllerPretsLis +class AbonneControllerPretsPagedLoansTest extends AbstractControllerTestCase { + protected $_storm_default_to_volatile = true; + + public function setUp() { + parent::setUp(); + $mock_web_client = $this->mock(); + $this->service = KohaFixtures::mockTwoLoansPages($mock_web_client); + + $this->lisianne = KohaFixtures::createUserLisianne($this, $this->service); + ZendAfi_Auth::getInstance()->logUser($this->lisianne); + + $this->fixture('Class_CodifAnnexe', ['id' => 33, + 'libelle' => 'Testing branch', + 'id_origine' => 'BIB']); + (new Class_Profil_Preferences()) + ->setModulePref(Class_Profil::getCurrentProfil(), + (new Class_Entity()) + ->setController('abonne') + ->setAction('prets'), + ['tools_composition' => 'pager;search_tool;export_barcodes;export_unimarc;extend_all;print']); + } + + + protected function _getCommParams($params=[]) { + return parent::_getCommParams(['loans_per_page' => 1]); + } + + + /** @test */ + public function serializeEmprunteurShouldNotFetchLoans() { + serialize($this->lisianne->getEmprunteur()); + $this->assertFalse($this->service->getWebClient() + ->methodHasBeenCalledWithParams('open_url', + ['http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=0&show_loans=1&show_holds=0&loans_per_page=1&loans_page=1'])); + } + + + /** @test */ + public function idShouldbe16186() { + $this->assertEquals(16186, $this->lisianne->getEmprunteur()->getId()); + } + + + /** @test */ + public function linkLoadAllLoansShouldBePresent() { + $this->dispatch('/opac/abonne/fiche'); + $this->assertXPathContentContains('//a[contains(@href,"abonne/prets/pages/all")]', + utf8_encode('Voir tous mes prêts')); + $this->assertFalse($this->service->getWebClient() + ->methodHasBeenCalledWithParams('open_url', + ['http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=0&show_loans=1&show_holds=0&loans_per_page=1&loans_page=1'])); + } + + + /** @test */ + public function dispatchOnAbonnePretShouldFetchAllPages() { + $this->dispatch('/opac/abonne/prets/pages/all'); + $this->assertXPathContentContains('//td','Faucon'); + } +} + + + + class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListThreePretsTestCase { public function setUp() { parent::setUp(); diff --git a/tests/application/modules/opac/controllers/AuthControllerLostPasswordTest.php b/tests/application/modules/opac/controllers/AuthControllerLostPasswordTest.php index e9fa77ea2aa2523979b63ff3de3ad4581285da89..44fd30b7a782cb98332609f342a2b448d5bfb1f8 100644 --- a/tests/application/modules/opac/controllers/AuthControllerLostPasswordTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerLostPasswordTest.php @@ -372,7 +372,7 @@ class AuthControllerLostPasswordKohaOnDemandBorrowerCreationTest ->whenCalled('open_url')->with('http://localhost?service=LookupPatron&id=10002000') ->answers(KohaFixtures::xmlLookupPatronLaure()) - ->whenCalled('open_url')->with('http://localhost?service=GetPatronInfo&patron_id=572&show_contact=1&show_loans=1&show_holds=1') + ->whenCalled('open_url')->with('http://localhost?service=GetPatronInfo&patron_id=572&show_contact=1&show_loans=0&show_holds=1') ->answers(KohaFixtures::xmlGetPatronInfoLaure()) ; diff --git a/tests/application/modules/opac/controllers/AuthControllerTest.php b/tests/application/modules/opac/controllers/AuthControllerTest.php index 2837f8c8c0bb0a169d8dd6a740c85b9ba1f6e7ee..9c5d76247a5ba703e4f48ea9adca4ff628c58134 100644 --- a/tests/application/modules/opac/controllers/AuthControllerTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerTest.php @@ -2583,24 +2583,24 @@ class AuthControllerPostWithSameIdSigbTest extends AbstractControllerTestCase { ->setPassword('bar') ->beValid(); - $service = $this->mock() - ->whenCalled('getEmprunteur') - ->answers($emprunteur) + $service = Storm_Test_ObjectWrapper::on(new Class_WebService_SIGB_TestingService()) + ->whenCalled('getEmprunteur') + ->answers($emprunteur) - ->whenCalled('saveEmprunteur') - ->answers(false) + ->whenCalled('saveEmprunteur') + ->answers(false) - ->whenCalled('getReservationsOf') - ->answers([]) + ->whenCalled('getReservationsOf') + ->answers([]) - ->whenCalled('getEmpruntsOf') - ->answers([]) + ->whenCalled('getEmpruntsOf') + ->answers([]) - ->whenCalled('isConnected') - ->answers(true) + ->whenCalled('isConnected') + ->answers(true) - ->whenCalled('providesAuthentication') - ->answers(true); + ->whenCalled('providesAuthentication') + ->answers(true); $params = ['url_serveur' => 'http://mon-koha-de-test.org', 'id_bib' => 56, @@ -2687,7 +2687,7 @@ class AuthControllerPostLoginWithDifferentIdIntBibTest ->setLibraryCode('PASC'); $emprunteur->beValid(); - $service = $this->mock() + $service = Storm_Test_ObjectWrapper::on(new Class_WebService_SIGB_TestingService()) ->whenCalled('getEmprunteur') ->answers($emprunteur) diff --git a/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php b/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php index 9a6a8382b54da51154f51643a9047071e77ce449..4f0f1b993e949c264c16408ad814d2efcfc8622b 100644 --- a/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php @@ -148,7 +148,11 @@ class AuthControllerDispatchAbonnePretsWithoutPasswordKohaTest extends AuthContr protected function _setService() { $this->_mock_web_client = $this->mock() ->whenCalled('open_url') - ->with('http://mon-koha-de-test.org?service=GetPatronInfo&patron_id=789&show_contact=1&show_loans=1&show_holds=1') + ->with('http://mon-koha-de-test.org?service=GetPatronInfo&patron_id=789&show_contact=1&show_loans=0&show_holds=1') + ->answers('') + + ->whenCalled('open_url') + ->with('http://mon-koha-de-test.org?service=GetPatronInfo&patron_id=&show_contact=0&show_loans=1&show_holds=0') ->answers('') ->beStrict(); @@ -172,6 +176,6 @@ class AuthControllerDispatchAbonnePretsWithoutPasswordKohaTest extends AuthContr $this->assertTrue( $this->_mock_web_client ->methodHasBeenCalledWithParams('open_url', - ['http://mon-koha-de-test.org?service=GetPatronInfo&patron_id=789&show_contact=1&show_loans=1&show_holds=1'])); + ['http://mon-koha-de-test.org?service=GetPatronInfo&patron_id=789&show_contact=1&show_loans=0&show_holds=1'])); } } \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/OnSiteConsultationTest.php b/tests/application/modules/opac/controllers/OnSiteConsultationTest.php index b4ec5ece40ae4d6498d667d35870586e213ac280..c3425cd02dba193a7c5be83b584b5f05398c98ce 100644 --- a/tests/application/modules/opac/controllers/OnSiteConsultationTest.php +++ b/tests/application/modules/opac/controllers/OnSiteConsultationTest.php @@ -97,7 +97,7 @@ abstract class OnSiteConsultationTestCase extends AbstractControllerTestCase { $sigb_exemplaire = new Class_WebService_SIGB_Exemplaire(1); $sigb_exemplaire->setReservable('true'); - $this->_mock_service = $this->mock() + $this->_mock_service = Storm_Test_ObjectWrapper::on( new Class_WebService_SIGB_TestingService()) ->whenCalled('getExemplaire') ->answers($sigb_exemplaire) diff --git a/tests/application/modules/telephone/controllers/AbonneControllerTest.php b/tests/application/modules/telephone/controllers/AbonneControllerTest.php index ea3a4e26b70460df8ce5610b47f6198707d383c7..a1eb3442b325dca8e329091fccd3cb73913bba56 100644 --- a/tests/application/modules/telephone/controllers/AbonneControllerTest.php +++ b/tests/application/modules/telephone/controllers/AbonneControllerTest.php @@ -326,7 +326,7 @@ class AbonneControllerTelephoneRenewSuccessTest extends AbonneControllerTelephon public function setUp() { parent::setUp(); - $this->_service = $this->mock() + $this->_service = Storm_Test_ObjectWrapper::on(new Class_WebService_SIGB_TestingService()) ->whenCalled('prolongerPret') ->answers(['statut' => true, 'erreur' => '']) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 0fc5bc15fe1c4b45b2ec5ff7f27eb62f1a2fd3c1..96fe057b3eb499e820cefd7cab4c5c762a5354a1 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -91,6 +91,7 @@ $translate->setLocale('fr'); require_once 'tests/library/ZendAfi/View/Helper/ViewHelperTestCase.php'; require_once 'tests/application/modules/admin/controllers/AdminAbstractControllerTestCase.php'; require_once 'tests/library/Class/ModelTestCase.php'; +require_once 'tests/library/Class/WebService/SIGB/TestingService.php'; require_once 'tests/fixtures/RessourcesNumeriquesFixtures.php'; require_once 'tests/fixtures/MockedClasses.php'; require_once 'tests/application/modules/telephone/controllers/TelephoneAbstractControllerTestCase.php'; diff --git a/tests/fixtures/KohaFixtures.php b/tests/fixtures/KohaFixtures.php index a92556b1c6d22b538ff8edd5db1910456641d5b2..733cffc4684ee9a1b668f7f049173240af26029b 100644 --- a/tests/fixtures/KohaFixtures.php +++ b/tests/fixtures/KohaFixtures.php @@ -20,6 +20,64 @@ */ class KohaFixtures { + public static function createUserLisianne($controller,$service) { + $webservice = 'http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl'; + $library = $controller->fixture('Class_IntBib', + ['id' => 3, + 'comm_sigb' => Class_IntBib::COM_KOHA, + 'comm_params' => [ 'url_serveur' => $webservice, + 'loans_per_page' => 1, + 'id_bib' => 3, + 'type' => 5]]); + + + return $controller->fixture('Class_Users', + ['id' => 43, + 'login' => 'lisianne', + 'password' => 'zork', + 'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, + 'idabon' => '16186', + 'id_site' => 3, + 'id_sigb' => '16186', + 'int_bib' => $library, + 'bib' => $library]); + } + + + public static function mockTwoLoansPages($mock_web_client) { + $params = ['url_serveur' => 'http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl', + 'loans_per_page' => 1, + 'id_bib' => 3, + 'type' => 5]; + + $service = Class_WebService_SIGB_Koha::getService($params); + + $mock_web_client + ->whenCalled('postData') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl', + [ 'service' => 'AuthenticatePatron', + 'username' => 'lisianne', + 'password' => 'zork']) + ->answers(KohaFixtures::xmlLookupPatronLisianne()) + + ->whenCalled('open_url') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=1&show_loans=0&show_holds=1') + ->answers(file_get_contents(__DIR__ . '/paged-contact-koha.xml')) + + ->whenCalled('open_url') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=0&show_loans=1&show_holds=0&loans_per_page=1&loans_page=1') + ->answers(file_get_contents(__DIR__ . '/paged-loans-koha.xml')) + + ->whenCalled('open_url') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=0&show_loans=1&show_holds=0&loans_per_page=1&loans_page=2') + ->answers(file_get_contents(__DIR__ . '/paged-loans-koha-2.xml')); + + $service->setWebClient($mock_web_client); + Class_WebService_SIGB_Koha::setService($params, + $service); + return $service; + } + public static function branches() { return '[ @@ -916,6 +974,46 @@ class KohaFixtures { } + public static function xmlGetPatronInfoLaureLoans() { + return '<?xml version="1.0" encoding="UTF-8" ?> + <GetPatronInfo> + <category_type>A</category_type> + <categorycode>INDIVIDU</categorycode> + <contactnote></contactnote> + <email>taz@gmail.com</email> + <B_country></B_country> + <loans></loans> + <borrowernumber>572</borrowernumber> + <lost>0</lost> + <branchcode>BDM</branchcode> + <amountoutstanding>0</amountoutstanding> + <description>Lecteur individuel</description> + <title>Mr</title> + <enrolmentperiod>12</enrolmentperiod> + <country></country> + <dateenrolled>2011-04-12</dateenrolled> + <guarantorid>0</guarantorid> + <borrowernotes></borrowernotes> + <dateexpiry>2012-04-12</dateexpiry> + <sort2></sort2> + <firstname>laurent</firstname> + <altcontactcountry></altcontactcountry> + <gonenoaddress>0</gonenoaddress> + <othernames></othernames> + <dateofbirth>1978-02-17</dateofbirth> + <B_address2></B_address2> + <branchname>Bibliothèque Départementale de la Meuse</branchname> + <surname>lafond</surname> + <gonenoaddresscomment></gonenoaddresscomment> + <cardnumber>10002000</cardnumber> + <opacnote></opacnote> + <initials>ll</initials> + <sort1>10</sort1> + <sex></sex> + </GetPatronInfo>'; + } + + public static function xmlLookupPatronJeanAndre() { return '<?xml version="1.0" encoding="UTF-8" ?> @@ -997,6 +1095,36 @@ class KohaFixtures { public static function xmlGetPatronInfoJeanAndre() { + return '<?xml version="1.0" encoding="UTF-8" ?> + <GetPatronInfo> + <category_type>A</category_type> + <categorycode>ADUEXT</categorycode> + <borrowernumber>419</borrowernumber> + <lost>0</lost> + <branchcode>BIB</branchcode> + <amountoutstanding>6</amountoutstanding> + <description>Adulte extérieur</description> + <title>M</title> + <enrolmentperiod>12</enrolmentperiod> + <charges>6.00</charges> + <dateenrolled>2009-03-04</dateenrolled> + <borrowernotes></borrowernotes> + <dateexpiry>2010-03-04</dateexpiry> + <firstname>Jean-André</firstname> + <gonenoaddress>0</gonenoaddress> + <dateofbirth>1984-06-08</dateofbirth> + <debarred>0</debarred> + <branchname>Bibliothèque Jean Prunier</branchname> + <surname>SANTONI</surname> + <cardnumber>815</cardnumber> + <initials>JAS</initials> + <sort1>CSP5</sort1> + <sex>M</sex> + </GetPatronInfo>'; + } + + + public static function xmlGetPatronInfoJeanAndreLoans() { return '<?xml version="1.0" encoding="UTF-8" ?> <GetPatronInfo> <category_type>A</category_type> diff --git a/tests/fixtures/paged-contact-koha.xml b/tests/fixtures/paged-contact-koha.xml new file mode 100644 index 0000000000000000000000000000000000000000..88f2cc40df391890158f2a01dd90c1f7d9462b9b --- /dev/null +++ b/tests/fixtures/paged-contact-koha.xml @@ -0,0 +1,352 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<GetPatronInfo> + <city>MULHOUSE</city> + <cardnumber>401028401</cardnumber> + <reservefee>0.000000</reservefee> + <B_address></B_address> + <mobile></mobile> + <updated_on>2018-02-16 10:37:57</updated_on> + <firstname>Lisianne</firstname> + <total_loans>2</total_loans> + <dateexpiry>2019-02-23</dateexpiry> + <email>croquis@wanadoo.fr</email> + <streetnumber>66A</streetnumber> + <sex>F</sex> + <zipcode>68100</zipcode> + <altcontactzipcode></altcontactzipcode> + <sort1></sort1> + <BlockExpiredPatronOpacActions>1</BlockExpiredPatronOpacActions> + <holds> + <hold> + <branchcode>SALVATOR</branchcode> + <title>Treize jours</title> + <itemnumber>374779</itemnumber> + <found>W</found> + <reserve_id>38014</reserve_id> + <suspend>0</suspend> + <lowestPriority>0</lowestPriority> + <waitingdate>2018-07-12</waitingdate> + <reservedate>2018-05-23</reservedate> + <item> + <volume>roman</volume> + <barcode>701358265</barcode> + <notforloan>0</notforloan> + <holdingbranch>SALVATOR</holdingbranch> + <biblioitemnumber>254840</biblioitemnumber> + <ccode>F-ROM</ccode> + <dateaccessioned>2017-09-27</dateaccessioned> + <ean>9782207135945</ean> + <itemlost>0</itemlost> + <renewals>2</renewals> + <datelastborrowed>2018-05-07</datelastborrowed> + <publishercode>Denoël</publishercode> + <itemnumber>374779</itemnumber> + <cn_sort></cn_sort> + <itemcallnumber>R GAY</itemcallnumber> + <collectiontitle>Et d'ailleurs</collectiontitle> + <issues>6</issues> + <replacementprice>22.90</replacementprice> + <biblionumber>254840</biblionumber> + <price>22.90</price> + <frameworkcode></frameworkcode> + <datelastseen>2018-07-12</datelastseen> + <pages>1 vol. (477 p.)</pages> + <itemtype>LIVRE</itemtype> + <permanent_location>A</permanent_location> + <isbn>9782207135945</isbn> + <collectionissn>1623-0949</collectionissn> + <withdrawn>0</withdrawn> + <size>21 x 14 cm</size> + <totalissues>6</totalissues> + <title>Treize jours</title> + <datecreated>2017-09-27</datecreated> + <homebranch>DROUOT</homebranch> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782207135945,0-4348927&Size=Original</url> + <author>Roxanne Gay</author> + <itype>LP</itype> + <location>A</location> + <publicationyear>2017</publicationyear> + <timestamp>2018-05-08 01:10:17</timestamp> + <damaged>0</damaged> + <restricted>0</restricted> + </item> + <priority>0</priority> + <timestamp>2018-07-12 10:37:34</timestamp> + <biblionumber>254840</biblionumber> + <borrowernumber>16186</borrowernumber> + <branchname>Bibliothèque Salvator</branchname> + </hold> + <hold> + <borrowernumber>16186</borrowernumber> + <branchname>Bibliothèque Salvator</branchname> + <priority>0</priority> + <timestamp>2018-07-11 15:30:50</timestamp> + <biblionumber>255220</biblionumber> + <reservedate>2018-05-23</reservedate> + <item> + <ean>9782743640781</ean> + <itemlost>0</itemlost> + <renewals>1</renewals> + <dateaccessioned>2017-10-05</dateaccessioned> + <ccode>F-POL</ccode> + <editionresponsibility>François Guérif</editionresponsibility> + <notforloan>0</notforloan> + <holdingbranch>SALVATOR</holdingbranch> + <biblioitemnumber>255220</biblioitemnumber> + <volume>roman noir</volume> + <barcode>21140941X</barcode> + <biblionumber>255220</biblionumber> + <price>19.50</price> + <replacementprice>19.50</replacementprice> + <issues>6</issues> + <collectiontitle>Rivages-Thriller</collectiontitle> + <itemcallnumber>RP DES</itemcallnumber> + <cn_sort></cn_sort> + <datelastborrowed>2018-05-15</datelastborrowed> + <publishercode>Rivages</publishercode> + <itemnumber>375601</itemnumber> + <totalissues>6</totalissues> + <withdrawn>0</withdrawn> + <collectionissn>0990-3151</collectionissn> + <isbn>9782743640781</isbn> + <permanent_location>A1</permanent_location> + <size>23 x 16 cm</size> + <itemtype>LIVRE</itemtype> + <pages>1 vol. (236 p.)</pages> + <datelastseen>2018-07-11</datelastseen> + <frameworkcode></frameworkcode> + <damaged>0</damaged> + <timestamp>2018-05-16 01:10:36</timestamp> + <restricted>0</restricted> + <publicationyear>2017</publicationyear> + <location>A1</location> + <itype>LP</itype> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782743640781,0-4318640&Size=Original</url> + <author>Pascal Dessaint</author> + <datecreated>2017-10-05</datecreated> + <homebranch>GRANDRUE</homebranch> + <title>Un homme doit mourir</title> + </item> + <lowestPriority>0</lowestPriority> + <reserve_id>38019</reserve_id> + <suspend>0</suspend> + <found>T</found> + <branchcode>SALVATOR</branchcode> + <itemnumber>375601</itemnumber> + <title>Un homme doit mourir</title> + </hold> + <hold> + <lowestPriority>0</lowestPriority> + <item> + <title>Pastorale américaine</title> + <datecreated>2017-07-03</datecreated> + <homebranch>GRANDRUE</homebranch> + <number>MUL_LA133397</number> + <itype>LP</itype> + <author>Philip Roth</author> + <damaged>0</damaged> + <timestamp>2018-06-28 01:10:02</timestamp> + <publicationyear>1999</publicationyear> + <location>A1</location> + <datelastseen>2018-06-27</datelastseen> + <frameworkcode></frameworkcode> + <itemtype>LIVRE</itemtype> + <pages>432 P.</pages> + <size>21 CM</size> + <withdrawn>0</withdrawn> + <isbn>2-07-075000-0</isbn> + <replacementpricedate>2017-07-03</replacementpricedate> + <permanent_location>A1</permanent_location> + <totalissues>4</totalissues> + <itemnumber>30398</itemnumber> + <datelastborrowed>2018-06-27</datelastborrowed> + <publishercode>Gallimard</publishercode> + <copynumber>F</copynumber> + <collectiontitle>Du monde entier</collectiontitle> + <itemcallnumber>R ROT</itemcallnumber> + <cn_sort></cn_sort> + <issues>79</issues> + <onloan>2018-07-25</onloan> + <biblionumber>28648</biblionumber> + <barcode>210873387</barcode> + <holdingbranch>GRANDRUE</holdingbranch> + <biblioitemnumber>28648</biblioitemnumber> + <notforloan>0</notforloan> + <dateaccessioned>1999-05-01</dateaccessioned> + <ccode>F-ROM</ccode> + <itemlost>0</itemlost> + </item> + <reservedate>2018-05-29</reservedate> + <biblionumber>28648</biblionumber> + <timestamp>2018-06-22 14:20:07</timestamp> + <priority>3</priority> + <branchname>Bibliothèque Salvator</branchname> + <borrowernumber>16186</borrowernumber> + <title>Pastorale américaine</title> + <itemnumber>30398</itemnumber> + <branchcode>SALVATOR</branchcode> + <suspend>0</suspend> + <reserve_id>38715</reserve_id> + </hold> + <hold> + <biblionumber>257368</biblionumber> + <timestamp>2018-07-13 16:22:54</timestamp> + <priority>15</priority> + <branchname>Bibliothèque Salvator</branchname> + <borrowernumber>16186</borrowernumber> + <lowestPriority>0</lowestPriority> + <item> + <damaged>0</damaged> + <timestamp>2018-07-04 01:10:23</timestamp> + <restricted>0</restricted> + <publicationyear>2018</publicationyear> + <location>A</location> + <itype>LP</itype> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782226392121,0-4657202&Size=Original</url> + <author>Pierre Lemaitre</author> + <datecreated>2018-02-20</datecreated> + <homebranch>SALVATOR</homebranch> + <title>Couleurs de l'incendie</title> + <booksellerid>2</booksellerid> + <totalissues>26</totalissues> + <withdrawn>0</withdrawn> + <permanent_location>A</permanent_location> + <isbn>9782226392121</isbn> + <replacementpricedate>2018-02-20</replacementpricedate> + <size>21 x 14 cm</size> + <itemtype>LIVRE</itemtype> + <pages>1 vol. (534 p.)</pages> + <datelastseen>2018-06-30</datelastseen> + <frameworkcode></frameworkcode> + <biblionumber>257368</biblionumber> + <price>22.90</price> + <onloan>2018-08-27</onloan> + <replacementprice>22.90</replacementprice> + <issues>6</issues> + <collectiontitle>Romans français</collectiontitle> + <itemcallnumber>R LEM</itemcallnumber> + <cn_sort></cn_sort> + <datelastborrowed>2018-06-30</datelastborrowed> + <publishercode>Albin Michel</publishercode> + <itemnumber>382471</itemnumber> + <copynumber>F</copynumber> + <ean>9782226392121</ean> + <itemlost>0</itemlost> + <dateaccessioned>2018-02-20</dateaccessioned> + <ccode>F-ROM</ccode> + <notforloan>0</notforloan> + <holdingbranch>BOURTZ</holdingbranch> + <biblioitemnumber>257368</biblioitemnumber> + <volume>roman</volume> + <barcode>401520737</barcode> + </item> + <reservedate>2018-06-07</reservedate> + <suspend>0</suspend> + <reserve_id>40055</reserve_id> + <title>Couleurs de l'incendie</title> + <itemnumber>382471</itemnumber> + <branchcode>SALVATOR</branchcode> + </hold> + <hold> + <borrowernumber>16186</borrowernumber> + <branchname>Bibliothèque Salvator</branchname> + <priority>2</priority> + <timestamp>2018-07-13 15:47:17</timestamp> + <biblionumber>259426</biblionumber> + <reservedate>2018-07-04</reservedate> + <item> + <itemlost>0</itemlost> + <ean>9782081416932</ean> + <dateaccessioned>2018-05-04</dateaccessioned> + <ccode>F-POL</ccode> + <biblioitemnumber>259426</biblioitemnumber> + <holdingbranch>FILATURE</holdingbranch> + <notforloan>0</notforloan> + <barcode>401533673</barcode> + <price>19.50</price> + <biblionumber>259426</biblionumber> + <replacementprice>19.50</replacementprice> + <issues>2</issues> + <cn_sort></cn_sort> + <itemcallnumber>RP RUF</itemcallnumber> + <itemnumber>387687</itemnumber> + <publishercode>Flammarion</publishercode> + <datelastborrowed>2018-06-05</datelastborrowed> + <copynumber>F</copynumber> + <totalissues>8</totalissues> + <size>20 x 13 cm</size> + <isbn>9782081416932</isbn> + <replacementpricedate>2018-05-04</replacementpricedate> + <permanent_location>A</permanent_location> + <withdrawn>0</withdrawn> + <itemtype>LIVRE</itemtype> + <pages>1 vol. (308 p.)</pages> + <datelastseen>2018-07-05</datelastseen> + <frameworkcode></frameworkcode> + <restricted>0</restricted> + <timestamp>2018-07-11 01:10:20</timestamp> + <damaged>0</damaged> + <location>A</location> + <publicationyear>2018</publicationyear> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782081416932,0-4897722&Size=Original</url> + <author>Jean-Christophe Rufin</author> + <itype>LP</itype> + <datecreated>2018-04-20</datecreated> + <homebranch>SALVATOR</homebranch> + <title>ˆLe ‰suspendu de Conakry</title> + <booksellerid>2</booksellerid> + </item> + <lowestPriority>0</lowestPriority> + <reserve_id>43024</reserve_id> + <suspend>0</suspend> + <branchcode>SALVATOR</branchcode> + <title>ˆLe ‰suspendu de Conakry</title> + <itemnumber>387687</itemnumber> + </hold> + </holds> + <title>Mme</title> + <B_phone></B_phone> + <dateenrolled>1994-01-01</dateenrolled> + <altcontactphone></altcontactphone> + <B_email></B_email> + <enrolmentperiod>12</enrolmentperiod> + <amountoutstanding>0</amountoutstanding> + <altcontactsurname></altcontactsurname> + <gonenoaddress>0</gonenoaddress> + <B_country></B_country> + <emailpro></emailpro> + <borrowernumber>16186</borrowernumber> + <borrowernotes></borrowernotes> + <branchcode>SALVATOR</branchcode> + <categorycode>ADU-GR</categorycode> + <B_streetnumber></B_streetnumber> + <opacnote></opacnote> + <lost>0</lost> + <altcontactaddress1></altcontactaddress1> + <othernames></othernames> + <phone>0389652347</phone> + <altcontactstate></altcontactstate> + <privacy_guarantor_checkouts>0</privacy_guarantor_checkouts> + <initials>ALE000010480</initials> + <surname>WINTZER</surname> + <altcontactaddress2></altcontactaddress2> + <altcontactcountry></altcontactcountry> + <altcontactfirstname></altcontactfirstname> + <contactnote></contactnote> + <checkprevcheckout>inherit</checkprevcheckout> + <sort2></sort2> + <B_city></B_city> + <dateofbirth>1947-12-01</dateofbirth> + <address>AVENUE ROBERT SCHUMAN</address> + <altcontactaddress3></altcontactaddress3> + <address2></address2> + <is_expired>0</is_expired> + <category_type>A</category_type> + <country></country> + <B_address2></B_address2> + <branchname>Bibliothèque Salvator</branchname> + <phonepro></phonepro> + <privacy>1</privacy> + <description>Adulte Gratuit</description> + <B_zipcode></B_zipcode> +</GetPatronInfo> diff --git a/tests/fixtures/paged-loans-koha-2.xml b/tests/fixtures/paged-loans-koha-2.xml new file mode 100644 index 0000000000000000000000000000000000000000..2932918a008b6e10c3531e11e3e2304526f5a79d --- /dev/null +++ b/tests/fixtures/paged-loans-koha-2.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<GetPatronInfo> + <city>MULHOUSE</city> + <cardnumber>401028401</cardnumber> + <reservefee>0.000000</reservefee> + <B_address></B_address> + <mobile></mobile> + <updated_on>2018-02-16 10:37:57</updated_on> + <firstname>Lisianne</firstname> + <loans> + <loan> + <itemcallnumber>708 325</itemcallnumber> + <cn_sort>708_325000000000000</cn_sort> + <datelastborrowed>2018-06-12</datelastborrowed> + <publishercode>Borricand</publishercode> + <itemnumber>89339</itemnumber> + <biblionumber>64886</biblionumber> + <onloan>2018-08-07</onloan> + <issues>1</issues> + <auto_renew>0</auto_renew> + <notforloan>0</notforloan> + <holdingbranch>SALVATOR</holdingbranch> + <biblioitemnumber>64886</biblioitemnumber> + <volume>histoire de l'Ordre souverain militaire et hospitalier de Saint-Jean-de-Jérusalem, de Rhodes et de Malte</volume> + <barcode>010074522</barcode> + <branchcode>SALVATOR</branchcode> + <lastreneweddate>2018-07-10 00:00:00</lastreneweddate> + <surname>WINTZER</surname> + <issuedate>2018-06-12 14:04</issuedate> + <renewals>1</renewals> + <itemlost>0</itemlost> + <dateaccessioned>2002-02-20</dateaccessioned> + <number>ALEPH_185873</number> + <more_subfields_xml><?xml version="1.0" encoding="UTF-8"?> +<collection + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" + xmlns="http://www.loc.gov/MARC21/slim"> + +<record> + <leader> a </leader> + <datafield tag="999" ind1=" " ind2=" "> + <subfield code="3">000183613000010</subfield> + <subfield code="q">ADU</subfield> + </datafield> +</record> + +</collection></more_subfields_xml> + <totalrenewals>1</totalrenewals> + <homebranch>GRANDRUE</homebranch> + <datecreated>2017-07-03</datecreated> + <title>Faucon</title> + <borrowernumber>16186</borrowernumber> + <publicationyear>1981</publicationyear> + <location>STO2</location> + <onsite_checkout>0</onsite_checkout> + <damaged>0</damaged> + <timestamp>2018-07-10 08:43:51</timestamp> + <issue_id>475239</issue_id> + <itype>IND</itype> + <author>René Borricand</author> + <firstname>Lisianne</firstname> + <itemtype>LIVRE</itemtype> + <date_due>2018-08-07 23:59</date_due> + <frameworkcode></frameworkcode> + <datelastseen>2018-06-12</datelastseen> + <cardnumber>401028401</cardnumber> + <withdrawn>0</withdrawn> + <date_due_sql>2018-08-07 23:59:00</date_due_sql> + <replacementpricedate>2017-07-03</replacementpricedate> + <permanent_location>STO2</permanent_location> + <isbn>2-85-397-007-8</isbn> + </loan> + </loans> + <total_loans>2</total_loans> + <dateexpiry>2019-02-23</dateexpiry> + <email>croquis@wanadoo.fr</email> + <streetnumber>66A</streetnumber> + <sex>F</sex> + <zipcode>68100</zipcode> + <altcontactzipcode></altcontactzipcode> + <sort1></sort1> + <BlockExpiredPatronOpacActions>1</BlockExpiredPatronOpacActions> + <title>Mme</title> + <B_phone></B_phone> + <dateenrolled>1994-01-01</dateenrolled> + <altcontactphone></altcontactphone> + <B_email></B_email> + <enrolmentperiod>12</enrolmentperiod> + <amountoutstanding>0</amountoutstanding> + <altcontactsurname></altcontactsurname> + <gonenoaddress>0</gonenoaddress> + <B_country></B_country> + <emailpro></emailpro> + <borrowernumber>16186</borrowernumber> + <borrowernotes></borrowernotes> + <branchcode>SALVATOR</branchcode> + <categorycode>ADU-GR</categorycode> + <B_streetnumber></B_streetnumber> + <opacnote></opacnote> + <lost>0</lost> + <altcontactaddress1></altcontactaddress1> + <othernames></othernames> + <phone>0389652347</phone> + <altcontactstate></altcontactstate> + <privacy_guarantor_checkouts>0</privacy_guarantor_checkouts> + <initials>ALE000010480</initials> + <surname>WINTZER</surname> + <altcontactaddress2></altcontactaddress2> + <altcontactcountry></altcontactcountry> + <altcontactfirstname></altcontactfirstname> + <contactnote></contactnote> + <checkprevcheckout>inherit</checkprevcheckout> + <sort2></sort2> + <B_city></B_city> + <dateofbirth>1947-12-01</dateofbirth> + <address>AVENUE ROBERT SCHUMAN</address> + <altcontactaddress3></altcontactaddress3> + <address2></address2> + <is_expired>0</is_expired> + <category_type>A</category_type> + <country></country> + <B_address2></B_address2> + <branchname>Bibliothèque Salvator</branchname> + <phonepro></phonepro> + <privacy>1</privacy> + <description>Adulte Gratuit</description> + <B_zipcode></B_zipcode> +</GetPatronInfo> diff --git a/tests/fixtures/paged-loans-koha.xml b/tests/fixtures/paged-loans-koha.xml new file mode 100644 index 0000000000000000000000000000000000000000..d4a06f5c077ddffbce6a230d467c42fb13385515 --- /dev/null +++ b/tests/fixtures/paged-loans-koha.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<GetPatronInfo> + <city>MULHOUSE</city> + <cardnumber>401028401</cardnumber> + <reservefee>0.000000</reservefee> + <B_address></B_address> + <mobile></mobile> + <updated_on>2018-02-16 10:37:57</updated_on> + <firstname>Lisianne</firstname> + <loans> + <loan> + <itemcallnumber>708 325</itemcallnumber> + <cn_sort>708_325000000000000</cn_sort> + <datelastborrowed>2018-06-12</datelastborrowed> + <publishercode>Borricand</publishercode> + <itemnumber>89339</itemnumber> + <biblionumber>64886</biblionumber> + <onloan>2018-08-07</onloan> + <issues>1</issues> + <auto_renew>0</auto_renew> + <notforloan>0</notforloan> + <holdingbranch>SALVATOR</holdingbranch> + <biblioitemnumber>64886</biblioitemnumber> + <volume>histoire de l'Ordre souverain militaire et hospitalier de Saint-Jean-de-Jérusalem, de Rhodes et de Malte</volume> + <barcode>010074522</barcode> + <branchcode>SALVATOR</branchcode> + <lastreneweddate>2018-07-10 00:00:00</lastreneweddate> + <surname>WINTZER</surname> + <issuedate>2018-06-12 14:04</issuedate> + <renewals>1</renewals> + <itemlost>0</itemlost> + <dateaccessioned>2002-02-20</dateaccessioned> + <number>ALEPH_185873</number> + <more_subfields_xml><?xml version="1.0" encoding="UTF-8"?> +<collection + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" + xmlns="http://www.loc.gov/MARC21/slim"> + +<record> + <leader> a </leader> + <datafield tag="999" ind1=" " ind2=" "> + <subfield code="3">000183613000010</subfield> + <subfield code="q">ADU</subfield> + </datafield> +</record> + +</collection></more_subfields_xml> + <totalrenewals>1</totalrenewals> + <homebranch>GRANDRUE</homebranch> + <datecreated>2017-07-03</datecreated> + <title>Malte</title> + <borrowernumber>16186</borrowernumber> + <publicationyear>1981</publicationyear> + <location>STO2</location> + <onsite_checkout>0</onsite_checkout> + <damaged>0</damaged> + <timestamp>2018-07-10 08:43:51</timestamp> + <issue_id>475239</issue_id> + <itype>IND</itype> + <author>René Borricand</author> + <firstname>Lisianne</firstname> + <itemtype>LIVRE</itemtype> + <date_due>2018-08-07 23:59</date_due> + <frameworkcode></frameworkcode> + <datelastseen>2018-06-12</datelastseen> + <cardnumber>401028401</cardnumber> + <withdrawn>0</withdrawn> + <date_due_sql>2018-08-07 23:59:00</date_due_sql> + <replacementpricedate>2017-07-03</replacementpricedate> + <permanent_location>STO2</permanent_location> + <isbn>2-85-397-007-8</isbn> + </loan> + </loans> + <total_loans>2</total_loans> + <dateexpiry>2019-02-23</dateexpiry> + <email>croquis@wanadoo.fr</email> + <streetnumber>66A</streetnumber> + <sex>F</sex> + <zipcode>68100</zipcode> + <altcontactzipcode></altcontactzipcode> + <sort1></sort1> + <BlockExpiredPatronOpacActions>1</BlockExpiredPatronOpacActions> + <title>Mme</title> + <B_phone></B_phone> + <dateenrolled>1994-01-01</dateenrolled> + <altcontactphone></altcontactphone> + <B_email></B_email> + <enrolmentperiod>12</enrolmentperiod> + <amountoutstanding>0</amountoutstanding> + <altcontactsurname></altcontactsurname> + <gonenoaddress>0</gonenoaddress> + <B_country></B_country> + <emailpro></emailpro> + <borrowernumber>16186</borrowernumber> + <borrowernotes></borrowernotes> + <branchcode>SALVATOR</branchcode> + <categorycode>ADU-GR</categorycode> + <B_streetnumber></B_streetnumber> + <opacnote></opacnote> + <lost>0</lost> + <altcontactaddress1></altcontactaddress1> + <othernames></othernames> + <phone>0389652347</phone> + <altcontactstate></altcontactstate> + <privacy_guarantor_checkouts>0</privacy_guarantor_checkouts> + <initials>ALE000010480</initials> + <surname>WINTZER</surname> + <altcontactaddress2></altcontactaddress2> + <altcontactcountry></altcontactcountry> + <altcontactfirstname></altcontactfirstname> + <contactnote></contactnote> + <checkprevcheckout>inherit</checkprevcheckout> + <sort2></sort2> + <B_city></B_city> + <dateofbirth>1947-12-01</dateofbirth> + <address>AVENUE ROBERT SCHUMAN</address> + <altcontactaddress3></altcontactaddress3> + <address2></address2> + <is_expired>0</is_expired> + <category_type>A</category_type> + <country></country> + <B_address2></B_address2> + <branchname>Bibliothèque Salvator</branchname> + <phonepro></phonepro> + <privacy>1</privacy> + <description>Adulte Gratuit</description> + <B_zipcode></B_zipcode> +</GetPatronInfo> diff --git a/tests/library/Class/UsersTest.php b/tests/library/Class/UsersTest.php index 347ffe0dd8efb123942ebcb7ca05213288a83078..99c030c7557f6b61a788e347f968dd0ddd531f84 100644 --- a/tests/library/Class/UsersTest.php +++ b/tests/library/Class/UsersTest.php @@ -262,7 +262,8 @@ class UsersFicheAbonneTest extends ModelTestCase { ->setCommParams(["url_serveur" => 'http://astrolabe.com/opsys.wsdl']) ->setCommSigb(2); - $this->webservice = $this->mock()->whenCalled('isConnected')->answers(true); + $this->webservice = Storm_Test_ObjectWrapper::on(new Class_WebService_SIGB_TestingService) + ->whenCalled('isConnected')->answers(true); Class_WebService_SIGB_Opsys::setService($this->webservice); diff --git a/tests/library/Class/WebService/SIGB/KohaTest.php b/tests/library/Class/WebService/SIGB/KohaTest.php index 833d2458b0dbd5f56e614e39a7e886e2ec688206..244216e848c33a9ee42fd2ad7a7a0974d4489fdb 100644 --- a/tests/library/Class/WebService/SIGB/KohaTest.php +++ b/tests/library/Class/WebService/SIGB/KohaTest.php @@ -466,9 +466,16 @@ class KohaGetEmprunteurLaureAfondTest extends KohaTestCase { 'username' => 'lafond', 'password' => 'afi']) ->answers(KohaFixtures::xmlLookupPatronLaure()) + ->whenCalled('open_url') - ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=572&show_contact=1&show_loans=1&show_holds=1') - ->answers(KohaFixtures::xmlGetPatronInfoLaure()); + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=572&show_contact=1&show_loans=0&show_holds=1') + ->answers(KohaFixtures::xmlGetPatronInfoLaure()) + + ->whenCalled('open_url') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=572&show_contact=0&show_loans=1&show_holds=0') + ->answers(KohaFixtures::xmlGetPatronInfoLaureLoans()) + ->beStrict(); +; $this->laurent = $this->service @@ -673,7 +680,6 @@ class KohaGetEmprunteurLaureAfondTest extends KohaTestCase { function fourthReservationIdShouldBe6789() { $this->assertEquals(6789, $this->laurent->getReservationAt(3)->getId()); } - } @@ -691,7 +697,10 @@ class KohaGetEmprunteurLisianneWithIdSIGBTest extends KohaTestCase { 'password' => 'zork']) ->answers(KohaFixtures::xmlLookupPatronLisianne()) ->whenCalled('open_url') - ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=1&show_loans=1&show_holds=1') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=1&show_loans=0&show_holds=1') + ->answers(file_get_contents(__DIR__ . '/holds-koha.xml')) + ->whenCalled('open_url') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=0&show_loans=1&show_holds=0') ->answers(file_get_contents(__DIR__ . '/loans-koha.xml')) ->beStrict(); @@ -749,7 +758,7 @@ class KohaGetEmprunteurDebarredWithIdSIGBTest extends KohaTestCase { 'password' => 'zork']) ->answers(KohaFixtures::xmlLookupPatronDebarred()) ->whenCalled('open_url') - ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=420&show_contact=1&show_loans=1&show_holds=1') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=420&show_contact=1&show_loans=0&show_holds=1') ->answers(KohaFixtures::xmlGetPatronInfoDebarred()); $this->jean = $this->service @@ -787,8 +796,12 @@ class KohaGetEmprunteurJeanAndreWithIdSIGBTest extends KohaTestCase { ->answers(KohaFixtures::xmlLookupPatronJeanAndre()) ->whenCalled('open_url') - ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=419&show_contact=1&show_loans=1&show_holds=1') - ->answers(KohaFixtures::xmlGetPatronInfoJeanAndre()); + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=419&show_contact=1&show_loans=0&show_holds=1') + ->answers(KohaFixtures::xmlGetPatronInfoJeanAndre()) + + ->whenCalled('open_url') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=419&show_contact=0&show_loans=1&show_holds=0') + ->answers(KohaFixtures::xmlGetPatronInfoJeanAndreLoans()); $this->fixture('Class_CodifAnnexe', ['id' => 33, 'libelle' => 'Testing branch', @@ -1026,7 +1039,7 @@ class KohaGetEmprunteurJamesBondWithGroupedHoldsTest extends KohaTestCase { ->answers(KohaFixtures::xmlLookupPatronJamesBond()) ->whenCalled('open_url') - ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=007&show_contact=1&show_loans=1&show_holds=1') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=007&show_contact=1&show_loans=0&show_holds=1') ->answers(KohaFixtures::xmlGetPatronInfoJamesBond()); $this->jamesbond = $this->service->getEmprunteur(Class_Users::newInstance() @@ -1591,7 +1604,7 @@ class KohaAuthenticateWSTest extends KohaTestCase { ->answers(KohaFixtures::xmlAuthenticatePatronLostCard()) ->whenCalled('open_url') - ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=96138&show_contact=1&show_loans=1&show_holds=1') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=96138&show_contact=1&show_loans=0&show_holds=1') ->answers(KohaFixtures::xmlGetPatronInfoDupont()); $this->user = $this->fixture('Class_Users', ['id' => 10, @@ -1773,14 +1786,66 @@ class KohaServiceLookupPatronByLoginTest extends KohaTestCase { $this->mock_web_client ->whenCalled('open_url') ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=LookupPatron&id=10002000') - ->answers(KohaFixtures::xmlLookupPatronLaure()) - - ->whenCalled('open_url') - ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=572&show_contact=1&show_loans=1&show_holds=1') - ->answers(KohaFixtures::xmlGetPatronInfoLaure()); + ->answers(KohaFixtures::xmlLookupPatronLaure()); $patron = $this->service->lookupPatronByLogin('10002000'); $this->assertTrue($patron->isValid()); } } + + + + +class KohaGetEmprunteurLisianneWithPagedLoansAndIdSIGBTest extends KohaTestCase { + public function setUp() { + parent::setUp(); + + $this->_service = KohaFixtures::mockTwoLoansPages($this->mock()); + $this->fixture('Class_CodifAnnexe', ['id' => 33, + 'libelle' => 'Testing branch', + 'id_origine' => 'BIB']); + + $this->lisianne = $this->_service + ->getEmprunteur(KohaFixtures::createUserLisianne($this, + $this->_service)); + + $this->lisianne->getEmprunts(); + } + + + /** @test */ + public function idShouldbe16186() { + $this->assertEquals(16186, $this->lisianne->getId()); + } + + + /** @test */ + public function prenomShouldBeLisianneAndre() { + $this->assertEquals('Lisianne', $this->lisianne->getPrenom()); + } + + + /** @test */ + public function nbEmpruntsShouldBeTwo() { + $this->assertEquals(2, $this->lisianne->getNbEmprunts()); + } + + + /** @test */ + public function nbReservationsShouldReturnFive() { + $this->assertEquals(5, $this->lisianne->getNbReservations()); + } + + + /** @test */ + public function firstEmpruntShouldBeFaucon() { + $this->assertEquals("Faucon", $this->lisianne->getEmpruntAt(0)->getTitre()); + } + + + /** @test */ + public function secondEmpruntShouldBeMalte() { + $this->assertEquals("Malte",$this->lisianne->getEmpruntAt(1)->getTitre()); + } +} diff --git a/tests/library/Class/WebService/SIGB/TestingService.php b/tests/library/Class/WebService/SIGB/TestingService.php new file mode 100644 index 0000000000000000000000000000000000000000..ac6d301af597f152ee3ca7361cc2b98541f3ca80 --- /dev/null +++ b/tests/library/Class/WebService/SIGB/TestingService.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright (c) 2012-2019, 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 + */ + + +class Class_WebService_SIGB_TestingService extends Class_WebService_SIGB_AbstractService { + public function getEmprunteur($user) {} + + public function getUserAnnexe($user) {} + + public function reserverExemplaire($user, $exemplaire, $code_annexe) {} + + public function supprimerReservation($user, $reservation_id) {} + + public function prolongerPret($user, $pret_id) {} + + public function getNotice($id) {} + + public function getServerRoot() {} +} diff --git a/tests/library/Class/WebService/SIGB/holds-koha.xml b/tests/library/Class/WebService/SIGB/holds-koha.xml new file mode 100644 index 0000000000000000000000000000000000000000..8095d3179c06928998fdd0a5eaea9c1ea3044c55 --- /dev/null +++ b/tests/library/Class/WebService/SIGB/holds-koha.xml @@ -0,0 +1,351 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<GetPatronInfo> + <city>MULHOUSE</city> + <cardnumber>401028401</cardnumber> + <reservefee>0.000000</reservefee> + <B_address></B_address> + <mobile></mobile> + <updated_on>2018-02-16 10:37:57</updated_on> + <firstname>Lisianne</firstname> + <dateexpiry>2019-02-23</dateexpiry> + <email>croquis@wanadoo.fr</email> + <streetnumber>66A</streetnumber> + <sex>F</sex> + <zipcode>68100</zipcode> + <altcontactzipcode></altcontactzipcode> + <sort1></sort1> + <BlockExpiredPatronOpacActions>1</BlockExpiredPatronOpacActions> + <holds> + <hold> + <branchcode>SALVATOR</branchcode> + <title>Treize jours</title> + <itemnumber>374779</itemnumber> + <found>W</found> + <reserve_id>38014</reserve_id> + <suspend>0</suspend> + <lowestPriority>0</lowestPriority> + <waitingdate>2018-07-12</waitingdate> + <reservedate>2018-05-23</reservedate> + <item> + <volume>roman</volume> + <barcode>701358265</barcode> + <notforloan>0</notforloan> + <holdingbranch>SALVATOR</holdingbranch> + <biblioitemnumber>254840</biblioitemnumber> + <ccode>F-ROM</ccode> + <dateaccessioned>2017-09-27</dateaccessioned> + <ean>9782207135945</ean> + <itemlost>0</itemlost> + <renewals>2</renewals> + <datelastborrowed>2018-05-07</datelastborrowed> + <publishercode>Denoël</publishercode> + <itemnumber>374779</itemnumber> + <cn_sort></cn_sort> + <itemcallnumber>R GAY</itemcallnumber> + <collectiontitle>Et d'ailleurs</collectiontitle> + <issues>6</issues> + <replacementprice>22.90</replacementprice> + <biblionumber>254840</biblionumber> + <price>22.90</price> + <frameworkcode></frameworkcode> + <datelastseen>2018-07-12</datelastseen> + <pages>1 vol. (477 p.)</pages> + <itemtype>LIVRE</itemtype> + <permanent_location>A</permanent_location> + <isbn>9782207135945</isbn> + <collectionissn>1623-0949</collectionissn> + <withdrawn>0</withdrawn> + <size>21 x 14 cm</size> + <totalissues>6</totalissues> + <title>Treize jours</title> + <datecreated>2017-09-27</datecreated> + <homebranch>DROUOT</homebranch> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782207135945,0-4348927&Size=Original</url> + <author>Roxanne Gay</author> + <itype>LP</itype> + <location>A</location> + <publicationyear>2017</publicationyear> + <timestamp>2018-05-08 01:10:17</timestamp> + <damaged>0</damaged> + <restricted>0</restricted> + </item> + <priority>0</priority> + <timestamp>2018-07-12 10:37:34</timestamp> + <biblionumber>254840</biblionumber> + <borrowernumber>16186</borrowernumber> + <branchname>Bibliothèque Salvator</branchname> + </hold> + <hold> + <borrowernumber>16186</borrowernumber> + <branchname>Bibliothèque Salvator</branchname> + <priority>0</priority> + <timestamp>2018-07-11 15:30:50</timestamp> + <biblionumber>255220</biblionumber> + <reservedate>2018-05-23</reservedate> + <item> + <ean>9782743640781</ean> + <itemlost>0</itemlost> + <renewals>1</renewals> + <dateaccessioned>2017-10-05</dateaccessioned> + <ccode>F-POL</ccode> + <editionresponsibility>François Guérif</editionresponsibility> + <notforloan>0</notforloan> + <holdingbranch>SALVATOR</holdingbranch> + <biblioitemnumber>255220</biblioitemnumber> + <volume>roman noir</volume> + <barcode>21140941X</barcode> + <biblionumber>255220</biblionumber> + <price>19.50</price> + <replacementprice>19.50</replacementprice> + <issues>6</issues> + <collectiontitle>Rivages-Thriller</collectiontitle> + <itemcallnumber>RP DES</itemcallnumber> + <cn_sort></cn_sort> + <datelastborrowed>2018-05-15</datelastborrowed> + <publishercode>Rivages</publishercode> + <itemnumber>375601</itemnumber> + <totalissues>6</totalissues> + <withdrawn>0</withdrawn> + <collectionissn>0990-3151</collectionissn> + <isbn>9782743640781</isbn> + <permanent_location>A1</permanent_location> + <size>23 x 16 cm</size> + <itemtype>LIVRE</itemtype> + <pages>1 vol. (236 p.)</pages> + <datelastseen>2018-07-11</datelastseen> + <frameworkcode></frameworkcode> + <damaged>0</damaged> + <timestamp>2018-05-16 01:10:36</timestamp> + <restricted>0</restricted> + <publicationyear>2017</publicationyear> + <location>A1</location> + <itype>LP</itype> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782743640781,0-4318640&Size=Original</url> + <author>Pascal Dessaint</author> + <datecreated>2017-10-05</datecreated> + <homebranch>GRANDRUE</homebranch> + <title>Un homme doit mourir</title> + </item> + <lowestPriority>0</lowestPriority> + <reserve_id>38019</reserve_id> + <suspend>0</suspend> + <found>T</found> + <branchcode>SALVATOR</branchcode> + <itemnumber>375601</itemnumber> + <title>Un homme doit mourir</title> + </hold> + <hold> + <lowestPriority>0</lowestPriority> + <item> + <title>Pastorale américaine</title> + <datecreated>2017-07-03</datecreated> + <homebranch>GRANDRUE</homebranch> + <number>MUL_LA133397</number> + <itype>LP</itype> + <author>Philip Roth</author> + <damaged>0</damaged> + <timestamp>2018-06-28 01:10:02</timestamp> + <publicationyear>1999</publicationyear> + <location>A1</location> + <datelastseen>2018-06-27</datelastseen> + <frameworkcode></frameworkcode> + <itemtype>LIVRE</itemtype> + <pages>432 P.</pages> + <size>21 CM</size> + <withdrawn>0</withdrawn> + <isbn>2-07-075000-0</isbn> + <replacementpricedate>2017-07-03</replacementpricedate> + <permanent_location>A1</permanent_location> + <totalissues>4</totalissues> + <itemnumber>30398</itemnumber> + <datelastborrowed>2018-06-27</datelastborrowed> + <publishercode>Gallimard</publishercode> + <copynumber>F</copynumber> + <collectiontitle>Du monde entier</collectiontitle> + <itemcallnumber>R ROT</itemcallnumber> + <cn_sort></cn_sort> + <issues>79</issues> + <onloan>2018-07-25</onloan> + <biblionumber>28648</biblionumber> + <barcode>210873387</barcode> + <holdingbranch>GRANDRUE</holdingbranch> + <biblioitemnumber>28648</biblioitemnumber> + <notforloan>0</notforloan> + <dateaccessioned>1999-05-01</dateaccessioned> + <ccode>F-ROM</ccode> + <itemlost>0</itemlost> + </item> + <reservedate>2018-05-29</reservedate> + <biblionumber>28648</biblionumber> + <timestamp>2018-06-22 14:20:07</timestamp> + <priority>3</priority> + <branchname>Bibliothèque Salvator</branchname> + <borrowernumber>16186</borrowernumber> + <title>Pastorale américaine</title> + <itemnumber>30398</itemnumber> + <branchcode>SALVATOR</branchcode> + <suspend>0</suspend> + <reserve_id>38715</reserve_id> + </hold> + <hold> + <biblionumber>257368</biblionumber> + <timestamp>2018-07-13 16:22:54</timestamp> + <priority>15</priority> + <branchname>Bibliothèque Salvator</branchname> + <borrowernumber>16186</borrowernumber> + <lowestPriority>0</lowestPriority> + <item> + <damaged>0</damaged> + <timestamp>2018-07-04 01:10:23</timestamp> + <restricted>0</restricted> + <publicationyear>2018</publicationyear> + <location>A</location> + <itype>LP</itype> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782226392121,0-4657202&Size=Original</url> + <author>Pierre Lemaitre</author> + <datecreated>2018-02-20</datecreated> + <homebranch>SALVATOR</homebranch> + <title>Couleurs de l'incendie</title> + <booksellerid>2</booksellerid> + <totalissues>26</totalissues> + <withdrawn>0</withdrawn> + <permanent_location>A</permanent_location> + <isbn>9782226392121</isbn> + <replacementpricedate>2018-02-20</replacementpricedate> + <size>21 x 14 cm</size> + <itemtype>LIVRE</itemtype> + <pages>1 vol. (534 p.)</pages> + <datelastseen>2018-06-30</datelastseen> + <frameworkcode></frameworkcode> + <biblionumber>257368</biblionumber> + <price>22.90</price> + <onloan>2018-08-27</onloan> + <replacementprice>22.90</replacementprice> + <issues>6</issues> + <collectiontitle>Romans français</collectiontitle> + <itemcallnumber>R LEM</itemcallnumber> + <cn_sort></cn_sort> + <datelastborrowed>2018-06-30</datelastborrowed> + <publishercode>Albin Michel</publishercode> + <itemnumber>382471</itemnumber> + <copynumber>F</copynumber> + <ean>9782226392121</ean> + <itemlost>0</itemlost> + <dateaccessioned>2018-02-20</dateaccessioned> + <ccode>F-ROM</ccode> + <notforloan>0</notforloan> + <holdingbranch>BOURTZ</holdingbranch> + <biblioitemnumber>257368</biblioitemnumber> + <volume>roman</volume> + <barcode>401520737</barcode> + </item> + <reservedate>2018-06-07</reservedate> + <suspend>0</suspend> + <reserve_id>40055</reserve_id> + <title>Couleurs de l'incendie</title> + <itemnumber>382471</itemnumber> + <branchcode>SALVATOR</branchcode> + </hold> + <hold> + <borrowernumber>16186</borrowernumber> + <branchname>Bibliothèque Salvator</branchname> + <priority>2</priority> + <timestamp>2018-07-13 15:47:17</timestamp> + <biblionumber>259426</biblionumber> + <reservedate>2018-07-04</reservedate> + <item> + <itemlost>0</itemlost> + <ean>9782081416932</ean> + <dateaccessioned>2018-05-04</dateaccessioned> + <ccode>F-POL</ccode> + <biblioitemnumber>259426</biblioitemnumber> + <holdingbranch>FILATURE</holdingbranch> + <notforloan>0</notforloan> + <barcode>401533673</barcode> + <price>19.50</price> + <biblionumber>259426</biblionumber> + <replacementprice>19.50</replacementprice> + <issues>2</issues> + <cn_sort></cn_sort> + <itemcallnumber>RP RUF</itemcallnumber> + <itemnumber>387687</itemnumber> + <publishercode>Flammarion</publishercode> + <datelastborrowed>2018-06-05</datelastborrowed> + <copynumber>F</copynumber> + <totalissues>8</totalissues> + <size>20 x 13 cm</size> + <isbn>9782081416932</isbn> + <replacementpricedate>2018-05-04</replacementpricedate> + <permanent_location>A</permanent_location> + <withdrawn>0</withdrawn> + <itemtype>LIVRE</itemtype> + <pages>1 vol. (308 p.)</pages> + <datelastseen>2018-07-05</datelastseen> + <frameworkcode></frameworkcode> + <restricted>0</restricted> + <timestamp>2018-07-11 01:10:20</timestamp> + <damaged>0</damaged> + <location>A</location> + <publicationyear>2018</publicationyear> + <url>http://www.electre.com/GetBlob.ashx?Ean=9782081416932,0-4897722&Size=Original</url> + <author>Jean-Christophe Rufin</author> + <itype>LP</itype> + <datecreated>2018-04-20</datecreated> + <homebranch>SALVATOR</homebranch> + <title>ˆLe ‰suspendu de Conakry</title> + <booksellerid>2</booksellerid> + </item> + <lowestPriority>0</lowestPriority> + <reserve_id>43024</reserve_id> + <suspend>0</suspend> + <branchcode>SALVATOR</branchcode> + <title>ˆLe ‰suspendu de Conakry</title> + <itemnumber>387687</itemnumber> + </hold> + </holds> + <title>Mme</title> + <B_phone></B_phone> + <dateenrolled>1994-01-01</dateenrolled> + <altcontactphone></altcontactphone> + <B_email></B_email> + <enrolmentperiod>12</enrolmentperiod> + <amountoutstanding>0</amountoutstanding> + <altcontactsurname></altcontactsurname> + <gonenoaddress>0</gonenoaddress> + <B_country></B_country> + <emailpro></emailpro> + <borrowernumber>16186</borrowernumber> + <borrowernotes></borrowernotes> + <branchcode>SALVATOR</branchcode> + <categorycode>ADU-GR</categorycode> + <B_streetnumber></B_streetnumber> + <opacnote></opacnote> + <lost>0</lost> + <altcontactaddress1></altcontactaddress1> + <othernames></othernames> + <phone>0389652347</phone> + <altcontactstate></altcontactstate> + <privacy_guarantor_checkouts>0</privacy_guarantor_checkouts> + <initials>ALE000010480</initials> + <surname>WINTZER</surname> + <altcontactaddress2></altcontactaddress2> + <altcontactcountry></altcontactcountry> + <altcontactfirstname></altcontactfirstname> + <contactnote></contactnote> + <checkprevcheckout>inherit</checkprevcheckout> + <sort2></sort2> + <B_city></B_city> + <dateofbirth>1947-12-01</dateofbirth> + <address>AVENUE ROBERT SCHUMAN</address> + <altcontactaddress3></altcontactaddress3> + <address2></address2> + <is_expired>0</is_expired> + <category_type>A</category_type> + <country></country> + <B_address2></B_address2> + <branchname>Bibliothèque Salvator</branchname> + <phonepro></phonepro> + <privacy>1</privacy> + <description>Adulte Gratuit</description> + <B_zipcode></B_zipcode> +</GetPatronInfo> diff --git a/tests/library/Class/WebService/SIGB/loans-koha.xml b/tests/library/Class/WebService/SIGB/loans-koha.xml index f0da21beabe5c1647f2e7e84b47b1261d73bc4d7..188564ee627d305fdfeb49415ce4d320f6b67e50 100644 --- a/tests/library/Class/WebService/SIGB/loans-koha.xml +++ b/tests/library/Class/WebService/SIGB/loans-koha.xml @@ -599,294 +599,6 @@ <altcontactzipcode></altcontactzipcode> <sort1></sort1> <BlockExpiredPatronOpacActions>1</BlockExpiredPatronOpacActions> - <holds> - <hold> - <branchcode>SALVATOR</branchcode> - <title>Treize jours</title> - <itemnumber>374779</itemnumber> - <found>W</found> - <reserve_id>38014</reserve_id> - <suspend>0</suspend> - <lowestPriority>0</lowestPriority> - <waitingdate>2018-07-12</waitingdate> - <reservedate>2018-05-23</reservedate> - <item> - <volume>roman</volume> - <barcode>701358265</barcode> - <notforloan>0</notforloan> - <holdingbranch>SALVATOR</holdingbranch> - <biblioitemnumber>254840</biblioitemnumber> - <ccode>F-ROM</ccode> - <dateaccessioned>2017-09-27</dateaccessioned> - <ean>9782207135945</ean> - <itemlost>0</itemlost> - <renewals>2</renewals> - <datelastborrowed>2018-05-07</datelastborrowed> - <publishercode>Denoël</publishercode> - <itemnumber>374779</itemnumber> - <cn_sort></cn_sort> - <itemcallnumber>R GAY</itemcallnumber> - <collectiontitle>Et d'ailleurs</collectiontitle> - <issues>6</issues> - <replacementprice>22.90</replacementprice> - <biblionumber>254840</biblionumber> - <price>22.90</price> - <frameworkcode></frameworkcode> - <datelastseen>2018-07-12</datelastseen> - <pages>1 vol. (477 p.)</pages> - <itemtype>LIVRE</itemtype> - <permanent_location>A</permanent_location> - <isbn>9782207135945</isbn> - <collectionissn>1623-0949</collectionissn> - <withdrawn>0</withdrawn> - <size>21 x 14 cm</size> - <totalissues>6</totalissues> - <title>Treize jours</title> - <datecreated>2017-09-27</datecreated> - <homebranch>DROUOT</homebranch> - <url>http://www.electre.com/GetBlob.ashx?Ean=9782207135945,0-4348927&Size=Original</url> - <author>Roxanne Gay</author> - <itype>LP</itype> - <location>A</location> - <publicationyear>2017</publicationyear> - <timestamp>2018-05-08 01:10:17</timestamp> - <damaged>0</damaged> - <restricted>0</restricted> - </item> - <priority>0</priority> - <timestamp>2018-07-12 10:37:34</timestamp> - <biblionumber>254840</biblionumber> - <borrowernumber>16186</borrowernumber> - <branchname>Bibliothèque Salvator</branchname> - </hold> - <hold> - <borrowernumber>16186</borrowernumber> - <branchname>Bibliothèque Salvator</branchname> - <priority>0</priority> - <timestamp>2018-07-11 15:30:50</timestamp> - <biblionumber>255220</biblionumber> - <reservedate>2018-05-23</reservedate> - <item> - <ean>9782743640781</ean> - <itemlost>0</itemlost> - <renewals>1</renewals> - <dateaccessioned>2017-10-05</dateaccessioned> - <ccode>F-POL</ccode> - <editionresponsibility>François Guérif</editionresponsibility> - <notforloan>0</notforloan> - <holdingbranch>SALVATOR</holdingbranch> - <biblioitemnumber>255220</biblioitemnumber> - <volume>roman noir</volume> - <barcode>21140941X</barcode> - <biblionumber>255220</biblionumber> - <price>19.50</price> - <replacementprice>19.50</replacementprice> - <issues>6</issues> - <collectiontitle>Rivages-Thriller</collectiontitle> - <itemcallnumber>RP DES</itemcallnumber> - <cn_sort></cn_sort> - <datelastborrowed>2018-05-15</datelastborrowed> - <publishercode>Rivages</publishercode> - <itemnumber>375601</itemnumber> - <totalissues>6</totalissues> - <withdrawn>0</withdrawn> - <collectionissn>0990-3151</collectionissn> - <isbn>9782743640781</isbn> - <permanent_location>A1</permanent_location> - <size>23 x 16 cm</size> - <itemtype>LIVRE</itemtype> - <pages>1 vol. (236 p.)</pages> - <datelastseen>2018-07-11</datelastseen> - <frameworkcode></frameworkcode> - <damaged>0</damaged> - <timestamp>2018-05-16 01:10:36</timestamp> - <restricted>0</restricted> - <publicationyear>2017</publicationyear> - <location>A1</location> - <itype>LP</itype> - <url>http://www.electre.com/GetBlob.ashx?Ean=9782743640781,0-4318640&Size=Original</url> - <author>Pascal Dessaint</author> - <datecreated>2017-10-05</datecreated> - <homebranch>GRANDRUE</homebranch> - <title>Un homme doit mourir</title> - </item> - <lowestPriority>0</lowestPriority> - <reserve_id>38019</reserve_id> - <suspend>0</suspend> - <found>T</found> - <branchcode>SALVATOR</branchcode> - <itemnumber>375601</itemnumber> - <title>Un homme doit mourir</title> - </hold> - <hold> - <lowestPriority>0</lowestPriority> - <item> - <title>Pastorale américaine</title> - <datecreated>2017-07-03</datecreated> - <homebranch>GRANDRUE</homebranch> - <number>MUL_LA133397</number> - <itype>LP</itype> - <author>Philip Roth</author> - <damaged>0</damaged> - <timestamp>2018-06-28 01:10:02</timestamp> - <publicationyear>1999</publicationyear> - <location>A1</location> - <datelastseen>2018-06-27</datelastseen> - <frameworkcode></frameworkcode> - <itemtype>LIVRE</itemtype> - <pages>432 P.</pages> - <size>21 CM</size> - <withdrawn>0</withdrawn> - <isbn>2-07-075000-0</isbn> - <replacementpricedate>2017-07-03</replacementpricedate> - <permanent_location>A1</permanent_location> - <totalissues>4</totalissues> - <itemnumber>30398</itemnumber> - <datelastborrowed>2018-06-27</datelastborrowed> - <publishercode>Gallimard</publishercode> - <copynumber>F</copynumber> - <collectiontitle>Du monde entier</collectiontitle> - <itemcallnumber>R ROT</itemcallnumber> - <cn_sort></cn_sort> - <issues>79</issues> - <onloan>2018-07-25</onloan> - <biblionumber>28648</biblionumber> - <barcode>210873387</barcode> - <holdingbranch>GRANDRUE</holdingbranch> - <biblioitemnumber>28648</biblioitemnumber> - <notforloan>0</notforloan> - <dateaccessioned>1999-05-01</dateaccessioned> - <ccode>F-ROM</ccode> - <itemlost>0</itemlost> - </item> - <reservedate>2018-05-29</reservedate> - <biblionumber>28648</biblionumber> - <timestamp>2018-06-22 14:20:07</timestamp> - <priority>3</priority> - <branchname>Bibliothèque Salvator</branchname> - <borrowernumber>16186</borrowernumber> - <title>Pastorale américaine</title> - <itemnumber>30398</itemnumber> - <branchcode>SALVATOR</branchcode> - <suspend>0</suspend> - <reserve_id>38715</reserve_id> - </hold> - <hold> - <biblionumber>257368</biblionumber> - <timestamp>2018-07-13 16:22:54</timestamp> - <priority>15</priority> - <branchname>Bibliothèque Salvator</branchname> - <borrowernumber>16186</borrowernumber> - <lowestPriority>0</lowestPriority> - <item> - <damaged>0</damaged> - <timestamp>2018-07-04 01:10:23</timestamp> - <restricted>0</restricted> - <publicationyear>2018</publicationyear> - <location>A</location> - <itype>LP</itype> - <url>http://www.electre.com/GetBlob.ashx?Ean=9782226392121,0-4657202&Size=Original</url> - <author>Pierre Lemaitre</author> - <datecreated>2018-02-20</datecreated> - <homebranch>SALVATOR</homebranch> - <title>Couleurs de l'incendie</title> - <booksellerid>2</booksellerid> - <totalissues>26</totalissues> - <withdrawn>0</withdrawn> - <permanent_location>A</permanent_location> - <isbn>9782226392121</isbn> - <replacementpricedate>2018-02-20</replacementpricedate> - <size>21 x 14 cm</size> - <itemtype>LIVRE</itemtype> - <pages>1 vol. (534 p.)</pages> - <datelastseen>2018-06-30</datelastseen> - <frameworkcode></frameworkcode> - <biblionumber>257368</biblionumber> - <price>22.90</price> - <onloan>2018-08-27</onloan> - <replacementprice>22.90</replacementprice> - <issues>6</issues> - <collectiontitle>Romans français</collectiontitle> - <itemcallnumber>R LEM</itemcallnumber> - <cn_sort></cn_sort> - <datelastborrowed>2018-06-30</datelastborrowed> - <publishercode>Albin Michel</publishercode> - <itemnumber>382471</itemnumber> - <copynumber>F</copynumber> - <ean>9782226392121</ean> - <itemlost>0</itemlost> - <dateaccessioned>2018-02-20</dateaccessioned> - <ccode>F-ROM</ccode> - <notforloan>0</notforloan> - <holdingbranch>BOURTZ</holdingbranch> - <biblioitemnumber>257368</biblioitemnumber> - <volume>roman</volume> - <barcode>401520737</barcode> - </item> - <reservedate>2018-06-07</reservedate> - <suspend>0</suspend> - <reserve_id>40055</reserve_id> - <title>Couleurs de l'incendie</title> - <itemnumber>382471</itemnumber> - <branchcode>SALVATOR</branchcode> - </hold> - <hold> - <borrowernumber>16186</borrowernumber> - <branchname>Bibliothèque Salvator</branchname> - <priority>2</priority> - <timestamp>2018-07-13 15:47:17</timestamp> - <biblionumber>259426</biblionumber> - <reservedate>2018-07-04</reservedate> - <item> - <itemlost>0</itemlost> - <ean>9782081416932</ean> - <dateaccessioned>2018-05-04</dateaccessioned> - <ccode>F-POL</ccode> - <biblioitemnumber>259426</biblioitemnumber> - <holdingbranch>FILATURE</holdingbranch> - <notforloan>0</notforloan> - <barcode>401533673</barcode> - <price>19.50</price> - <biblionumber>259426</biblionumber> - <replacementprice>19.50</replacementprice> - <issues>2</issues> - <cn_sort></cn_sort> - <itemcallnumber>RP RUF</itemcallnumber> - <itemnumber>387687</itemnumber> - <publishercode>Flammarion</publishercode> - <datelastborrowed>2018-06-05</datelastborrowed> - <copynumber>F</copynumber> - <totalissues>8</totalissues> - <size>20 x 13 cm</size> - <isbn>9782081416932</isbn> - <replacementpricedate>2018-05-04</replacementpricedate> - <permanent_location>A</permanent_location> - <withdrawn>0</withdrawn> - <itemtype>LIVRE</itemtype> - <pages>1 vol. (308 p.)</pages> - <datelastseen>2018-07-05</datelastseen> - <frameworkcode></frameworkcode> - <restricted>0</restricted> - <timestamp>2018-07-11 01:10:20</timestamp> - <damaged>0</damaged> - <location>A</location> - <publicationyear>2018</publicationyear> - <url>http://www.electre.com/GetBlob.ashx?Ean=9782081416932,0-4897722&Size=Original</url> - <author>Jean-Christophe Rufin</author> - <itype>LP</itype> - <datecreated>2018-04-20</datecreated> - <homebranch>SALVATOR</homebranch> - <title>ˆLe ‰suspendu de Conakry</title> - <booksellerid>2</booksellerid> - </item> - <lowestPriority>0</lowestPriority> - <reserve_id>43024</reserve_id> - <suspend>0</suspend> - <branchcode>SALVATOR</branchcode> - <title>ˆLe ‰suspendu de Conakry</title> - <itemnumber>387687</itemnumber> - </hold> - </holds> <title>Mme</title> <B_phone></B_phone> <dateenrolled>1994-01-01</dateenrolled> diff --git a/tests/scenarios/HandleBranchcode/HandleBranchcodeTest.php b/tests/scenarios/HandleBranchcode/HandleBranchcodeTest.php index cc0e07ba5d90e35e290affe2cbcd3c9c256738a1..1d6cf9de9844fca6f3205f791816dc843553caf6 100644 --- a/tests/scenarios/HandleBranchcode/HandleBranchcodeTest.php +++ b/tests/scenarios/HandleBranchcode/HandleBranchcodeTest.php @@ -41,7 +41,7 @@ abstract class HandleBranchcodeTestCase extends AbstractControllerTestCase { ->answers(ChamberyKohaFixtures::authenticatePatronChambelle()) ->whenCalled('open_url') - ->with($this->ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=1&show_holds=1') + ->with($this->ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=0&show_holds=1') ->answers(ChamberyKohaFixtures::getPatronInfoChambelle()); } diff --git a/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php b/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php index fa33a5b0e172e68ca372e7a42e5804d5b93dbd21..29f5f25640e5460ccb24132c612000ec9351775c 100644 --- a/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php +++ b/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php @@ -257,7 +257,7 @@ class HandleOnholdWithOnHoldTest extends HandleOnholdDispatchTestCase { protected function _addCallToWebClient() { $this->_mock_web_client ->whenCalled('open_url') - ->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=1&show_holds=1') + ->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=0&show_holds=1') ->answers(ChamberyKohaFixtures::getPatronInfoChambelleWithOnhold()); } } @@ -269,7 +269,7 @@ class HandleOnholdWithItemOnHoldTest extends HandleOnholdDispatchTestCase { protected function _addCallToWebClient() { $this->_mock_web_client ->whenCalled('open_url') - ->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=1&show_holds=1') + ->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=0&show_holds=1') ->answers(ChamberyKohaFixtures::getPatronInfoChambelleWithItemonhold()); } } @@ -280,7 +280,7 @@ class HandleOnholdWithManyItemOnHoldTest extends HandleOnholdDispatchTestCase { protected function _addCallToWebClient() { $this->_mock_web_client ->whenCalled('open_url') - ->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=1&show_holds=1') + ->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=0&show_holds=1') ->answers(ChamberyKohaFixtures::getPatronInfoChambelleWithManyItemonhold()); } } \ No newline at end of file