diff --git a/VERSIONS_STABLE/hotline_#18504_pergame_subscriptions b/VERSIONS_STABLE/hotline_#18504_pergame_subscriptions new file mode 100644 index 0000000000000000000000000000000000000000..4022d240bf0ea861f4fae6149a245bcc9edb789b --- /dev/null +++ b/VERSIONS_STABLE/hotline_#18504_pergame_subscriptions @@ -0,0 +1,2 @@ + - ticket : #18504 + - SIGB Pergame: correction d'un bug dans l'affichage des réservations en cours qui affichait une ressource numérique. \ No newline at end of file diff --git a/library/Class/Pret.php b/library/Class/Pret.php index 8429c49a87c7df68502960c73eaddbfebf9d094a..55547cf96b4dc8564702e61fa491c82160ad4c24 100644 --- a/library/Class/Pret.php +++ b/library/Class/Pret.php @@ -16,12 +16,12 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_Pret extends Storm_Model_Abstract { protected $_table_name = 'prets'; - protected $_table_primary = 'id_pret'; + protected $_table_primary = 'id_pret'; protected $_belongs_to = array('bib' => array('model' => 'Class_Bib', 'referenced_in' => 'id_site')); @@ -32,8 +32,8 @@ class Class_Pret extends Storm_Model_Abstract { public function getExemplaire() { - return Class_Exemplaire::getLoader()->findFirstBy(array('id_bib' => $this->getIdSite(), - 'code_barres' => $this->getCodeBarres())); + return Class_Exemplaire::findFirstBy(['id_bib' => $this->getIdSite(), + 'code_barres' => $this->getCodeBarres()]);$item; } } diff --git a/library/Class/Profil.php b/library/Class/Profil.php index 880b7ec61fddecff66e496642f622026dac71161..cd9b9ac39a9205444669899749e57201081947ba 100644 --- a/library/Class/Profil.php +++ b/library/Class/Profil.php @@ -212,8 +212,8 @@ class Class_Profil extends Storm_Model_Abstract { 'plan' => 1, 'resa' => 1, 'dispo' => 1, - 'date_retour' => 0], - 'en_pret' => 'En prêt']), + 'date_retour' => 0, + 'en_pret' => Class_WebService_SIGB_Exemplaire::DISPO_EN_PRET]]), 'hauteur_banniere' => 100, 'mail_site' => '', 'mail_suggestion_achat' => '', diff --git a/library/Class/Reservation.php b/library/Class/Reservation.php index 4f72f78104463e66fd2ab40f0989aeb912a956d5..2e75a6ed7b1f316e3dc098d2cfb7835c8c7accb4 100644 --- a/library/Class/Reservation.php +++ b/library/Class/Reservation.php @@ -16,15 +16,15 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_Reservation extends Storm_Model_Abstract { protected $_table_name = 'reservations'; - protected $_table_primary = 'id_resa'; + protected $_table_primary = 'id_resa'; - protected $_belongs_to = array('bib' => array('model' => 'Class_Bib', - 'referenced_in' => 'id_site')); + protected $_belongs_to = ['bib' => ['model' => 'Class_Bib', + 'referenced_in' => 'id_site']]; protected $_notice; @@ -33,7 +33,8 @@ class Class_Reservation extends Storm_Model_Abstract { if (isset($this->_notice)) return $this->_notice; - if ($exemplaire = Class_Exemplaire::getLoader()->findFirstBy(array('id_origine' => $this->getIdNoticeOrigine()))) + if ($exemplaire = Class_Exemplaire::findFirstBy(['id_origine' => $this->getIdNoticeOrigine(), + 'order' => 'zone995 desc'])) return $this->_notice = $exemplaire->getNotice(); return null; @@ -41,8 +42,8 @@ class Class_Reservation extends Storm_Model_Abstract { public function getRang() { - return 1 + $this->getLoader()->countBy(array('ID_NOTICE_ORIGINE' => $this->getIdNoticeOrigine(), - 'where' => sprintf('DATE_RESA<"%s"', $this->getDateResa()))); + return 1 + Class_Reservation::getLoader()->countBy(['ID_NOTICE_ORIGINE' => $this->getIdNoticeOrigine(), + 'where' => sprintf('DATE_RESA<"%s"', $this->getDateResa())]); } @@ -54,5 +55,4 @@ class Class_Reservation extends Storm_Model_Abstract { return "Réservé"; } } - ?> \ No newline at end of file diff --git a/library/Class/Systeme/PergameService.php b/library/Class/Systeme/PergameService.php index 33c2dabf0fd8b36641c7c23874bcb2ce4cfc7ee5..710f8c982bb27e6a508807ba49dca59daa02b27b 100644 --- a/library/Class/Systeme/PergameService.php +++ b/library/Class/Systeme/PergameService.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_Systeme_PergameService { @@ -58,7 +58,7 @@ class Class_Systeme_PergameService { $nb_resas=fetchOne("select count(*) from reservations where IDABON='".$this->user->IDABON."' and ORDREABON=".$this->user->ORDREABON); return $nb_resas; } - + public function getPrets() { $data=fetchAll("select * from prets where IDABON='".$this->user->IDABON."' and ORDREABON=".$this->user->ORDREABON." and EN_COURS=1"); @@ -80,31 +80,26 @@ class Class_Systeme_PergameService { public function getDisponibilite($ex) { - // terme en pret - $tmp=Class_Profil::getCurrentProfil()->getCfgNoticeAsArray(); - $libelle_en_pret="emprunté"; - if (array_isset("en_pret", $tmp["exemplaires"])) - $libelle_en_pret=$tmp["exemplaires"]["en_pret"]; - // verif pret $code_barres=$ex["code_barres"]; - $prets = fetchAll("select * from prets where code_barres='$code_barres' and EN_COURS=1"); + $prets = Class_Pret::findAllBy(['code_barres' => $code_barres, + 'en_cours' => 1]); // Activité $ex["dispo"]=$ex["activite"]; $ex["reservable"]=true; if ($prets) { - $ex["dispo"]=$libelle_en_pret; + $ex["dispo"] = Class_Profil::getCurrentProfil()->getCfgNoticeAsArray()['exemplaires']['en_pret']; $ex["date_retour"] = strftime('%d/%m/%y' ,strtotime($prets[0]['DATE_RETOUR'])); - } + } else { $regles=$this->getReglesReservation($ex["id_bib"]); if($regles["Autoriser_docs_disponibles"]==1) $ex["reservable"]=true; else $ex["reservable"]=false; } - + // nombre de réservations $nb_resas=fetchOne("select count(*) from reservations where ID_NOTICE_ORIGINE=".intval($ex["id_origine"])); if($nb_resas) @@ -152,7 +147,7 @@ class Class_Systeme_PergameService { return $notice; } - return ($model = Class_Notice::find($id_notice)) + return ($model = Class_Notice::find($id_notice)) ? $model->getNotice('JA') : []; } @@ -166,26 +161,26 @@ class Class_Systeme_PergameService { } foreach($ids as $id) { - if ($inSql > '') + if ($inSql > '') $inSql.=","; $inSql.=$id["id_notice"]; } $id_notice = fetchOne("select id_notice from notices where id_notice in($inSql) and type_doc=$support"); - return ($model = Class_Notice::find($id_notice)) + return ($model = Class_Notice::find($id_notice)) ? $model->getNotice('JA') : []; } public function reserverExemplairePergame($id_bib, $exemplaire, $code_annexe) { - if (!$this->user || !$this->user->ID_USER) + if (!$this->user || !$this->user->ID_USER) return ['erreur' => 'Vous devez être connecté pour réserver un document']; - if(!$this->user->IDABON) + if(!$this->user->IDABON) return ['erreur' => 'Vous devez être connecté en tant qu\'abonné pour réserver un document']; - - if (!$exemplaire) + + if (!$exemplaire) return ['erreur' => 'Une erreur s\'est produite lors de la lecture de la notice.']; $notice = $exemplaire->getNotice(); @@ -202,22 +197,22 @@ class Class_Systeme_PergameService { 'idabon' => $id_abon, 'ordreabon'=> $ordre_abon]); - if ($resa) + if ($resa) return ['erreur' => 'Vous avez déjà réservé ce document le ' . formatDate($resa->getDateResa(), 1)]; $regles = $this->getReglesReservation($exemplaire->getIdBib()); // controle quota par carte $nb = Class_Reservation::countBy(['idabon' => $id_abon]); - if ($nb >= $regles['Max_par_carte']) + if ($nb >= $regles['Max_par_carte']) return ['erreur' => 'La réservation est impossible car vous avez atteint le nombre maximum de réservations sur votre carte.']; - + // controle quota par document $nb = Class_Reservation::countBy(['id_notice_origine' => $id_origine]); if ($nb >= $regles['Max_par_document']) return ['erreur' => 'La réservation est impossible car le nombre maximum de réservations pour ce document a été atteint (' . $regles["Max_par_document"] . ').']; - - if (!$id_bib) + + if (!$id_bib) $id_bib = 1; $time_source = self::getTimeSource(); @@ -241,7 +236,7 @@ class Class_Systeme_PergameService { public function supprimerReservation($id_reservation) { $resa = fetchEnreg("select * from reservations where ID_RESA=$id_reservation"); - if(!$resa) + if(!$resa) return false; sqlExecute("delete from reservations where ID_RESA=$id_reservation"); @@ -269,7 +264,7 @@ class Class_Systeme_PergameService { $nbProlong = (int)$pret["NB_PROLONGATIONS"]; $nbProlong += 1; $dateRetour = $pret["DATE_RETOUR"]; - if($nbProlong > $regles["Nombre_max_par_document"]) + if($nbProlong > $regles["Nombre_max_par_document"]) return ['statut' => 0, 'erreur' => 'Le prêt n\'a pas pu être prolongé car il a atteint le nombre de prolongations autorisé.' . $complement_msg]; @@ -277,7 +272,7 @@ class Class_Systeme_PergameService { $anteriorite_max = (int)$regles['Anteriorite_max_en_jours']; if ($anteriorite_max) { $ecart = ecartDates($dateJour, $dateRetour); - if ($ecart>$anteriorite_max) + if ($ecart>$anteriorite_max) return ['statut' => 0, 'erreur' => 'Le prêt n\'a pas pu être prolongé car il a un retard trop important.' . $complement_msg]; } @@ -285,14 +280,14 @@ class Class_Systeme_PergameService { // Controle si le doc est réservé if ($regles['Interdire_si_reservation'] == 1) { $controle = fetchOne("Select Count(*) From reservations Where ID_NOTICE_ORIGINE=".$pret["ID_NOTICE_ORIGINE"]); - if($controle > 0) + if($controle > 0) return ['statut' => 0, 'erreur' => 'Le prêt n\'a pas pu être prolongé car il est réservé.' . $complement_msg]; } // On prolonge $newDate = ajouterJours($pret["DATE_RETOUR"], $regles['Duree_en_jours']); - while($newDate<=$dateJour) + while($newDate<=$dateJour) $newDate = ajouterJours($newDate,$regles['Duree_en_jours']); $tempsProlong=(int)$regles['Duree_en_jours']; @@ -312,7 +307,7 @@ class Class_Systeme_PergameService { private function ecrireTransaction($type_mvt, $enreg) { $data = ''; - foreach($enreg as $item) + foreach($enreg as $item) $data .= $item . '|'; Class_Transaction::newInstance(['type_mvt' => $type_mvt, 'data' => $data]) ->save(); @@ -320,13 +315,13 @@ class Class_Systeme_PergameService { public function getReglesReservation($id_bib) { - if (!$id_bib) + if (!$id_bib) return false; $bib = Class_IntBib::find($id_bib); $data = $bib->getCommParamsAsArray(); - if (!isset($data["Max_par_carte"])) + if (!isset($data["Max_par_carte"])) $data["Max_par_carte"] = 3; - if (!isset($data["Max_par_document"])) + if (!isset($data["Max_par_document"])) $data["Max_par_document"] = 3; return $data; } diff --git a/library/Class/WebService/SIGB/Emprunteur.php b/library/Class/WebService/SIGB/Emprunteur.php index 2b38b4808bc1abc7e705f8de6058ed50212cf08f..48fe7286a048278ec6ecb20eebbe20595fb1fcdf 100644 --- a/library/Class/WebService/SIGB/Emprunteur.php +++ b/library/Class/WebService/SIGB/Emprunteur.php @@ -16,11 +16,11 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Emprunteur { - protected + protected $_id, $_name, $_emprunts, @@ -44,7 +44,7 @@ class Class_WebService_SIGB_Emprunteur { $_date_naissance, $_is_contact_email= 0, $_is_contact_sms= 0; - + public function __sleep() { $this->getEmprunts(); @@ -551,7 +551,7 @@ class Class_WebService_SIGB_Emprunteur { public function getEndDate() { return $this->_end_date; } - + /** * @param Class_WebService_SIGB_AbstractService $service @@ -615,7 +615,7 @@ class Class_WebService_SIGB_Emprunteur { return $this; } - + /** * @return boolean */ diff --git a/library/Class/WebService/SIGB/Exemplaire.php b/library/Class/WebService/SIGB/Exemplaire.php index 749d489f9228f479e25b8562526bab51a3a5bebd..82383398640a3f5cd7e5ed1353f0d74efbdfafc1 100644 --- a/library/Class/WebService/SIGB/Exemplaire.php +++ b/library/Class/WebService/SIGB/Exemplaire.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Exemplaire { @@ -99,16 +99,16 @@ class Class_WebService_SIGB_Exemplaire { public function getExemplaireOPAC() { if (isset($this->_exemplaire_opac)) return $this->_exemplaire_opac; - + if ($no_notice = $this->getNoNotice()) $params = array('id_origine' => $no_notice); - + if ($this->code_barre) $params = array('code_barres' => $this->code_barre); if (!isset($params)) return null; - + return $this->_exemplaire_opac = Class_Exemplaire::getLoader()->findFirstBy($params); } @@ -182,7 +182,7 @@ class Class_WebService_SIGB_Exemplaire { return $this->bibliotheque; } - + public function getAuteur(){ if (!$this->auteur and ($notice = $this->getNoticeOPAC())) $this->auteur = $notice->getAuteurPrincipal(); @@ -294,13 +294,7 @@ class Class_WebService_SIGB_Exemplaire { public function getLibelleDispoEnPret() { - if (!$tmp = Class_Profil::getCurrentProfil()->getCfgNoticeAsArray()) - return self::DISPO_EN_PRET; - - if (array_isset("en_pret", $tmp["exemplaires"])) - return $tmp["exemplaires"]["en_pret"]; - - return self::DISPO_EN_PRET; + return Class_Profil::getCurrentProfil()->getCfgNoticeAsArray()['exemplaires']['en_pret']; } @@ -367,11 +361,11 @@ class Class_WebService_SIGB_Exemplaire { return $this; } - + public function getEdition() { return $this->edition; } - + public function getDisponibiliteLabel() { return $this->_disponibiliteLabel; diff --git a/library/Class/WebService/SIGB/Pergame/Service.php b/library/Class/WebService/SIGB/Pergame/Service.php index 14053507de7f350098e6f1d6ea821baf7885f349..40fadf007a975a19b0076983c912a8c4e6e47e7a 100644 --- a/library/Class/WebService/SIGB/Pergame/Service.php +++ b/library/Class/WebService/SIGB/Pergame/Service.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Pergame_Service extends Class_WebService_SIGB_AbstractService { @@ -63,16 +63,15 @@ class Class_WebService_SIGB_Pergame_Service extends Class_WebService_SIGB_Abstra } - public function getEmpruntsOf($emprunteur) - { - $params = Class_IntBib::getLoader()->find($this->_id_bib)->getCommParamsAsArray(); + public function getEmpruntsOf($emprunteur) { + $params = Class_IntBib::find($this->_id_bib)->getCommParamsAsArray(); $renouvelable = isset($params['Autoriser_prolongations']) ? $params['Autoriser_prolongations'] : false; - - $user = Class_Users::getLoader()->find($emprunteur->getId()); - $prets = Class_Pret::getLoader()->findAllBy(array('IDABON' => $user->getIdabon(), - 'ORDREABON' => $user->getOrdreabon(), - 'EN_COURS' => 1)); - $emprunts = array(); + + $user = Class_Users::find($emprunteur->getId()); + $prets = Class_Pret::findAllBy(['IDABON' => $user->getIdabon(), + 'ORDREABON' => $user->getOrdreabon(), + 'EN_COURS' => 1]); + $emprunts = []; foreach($prets as $pret) { $emprunts []= Class_WebService_SIGB_Emprunt::newInstanceWithEmptyExemplaire() @@ -90,7 +89,7 @@ class Class_WebService_SIGB_Pergame_Service extends Class_WebService_SIGB_Abstra $user = Class_Users::find($emprunteur->getId()); $reservations_db = Class_Reservation::findAllBy(['IDABON' => $user->getIdabon(), 'ORDREABON' => $user->getOrdreabon()]); - $reservations = array(); + $reservations = []; foreach($reservations_db as $reservation) { $bib = Class_Bib::find($reservation->getIdSite()); @@ -107,8 +106,8 @@ class Class_WebService_SIGB_Pergame_Service extends Class_WebService_SIGB_Abstra public function reserverExemplaire($user, $exemplaire, $code_annexe) { - return $this->getLegacyService()->reserverExemplairePergame($this->_id_bib, - $exemplaire, + return $this->getLegacyService()->reserverExemplairePergame($this->_id_bib, + $exemplaire, $code_annexe); } @@ -122,7 +121,7 @@ class Class_WebService_SIGB_Pergame_Service extends Class_WebService_SIGB_Abstra return $this->getLegacyService()->prolongerPret($pret_id); } - + public function getNotice($id){ if (!$exemplaire = Class_Exemplaire::getLoader()->findFirstBy(array('id_origine' => $id, 'id_bib' => $this->_id_bib))) diff --git a/library/Class/WebService/SIGB/Reservation.php b/library/Class/WebService/SIGB/Reservation.php index ff8d5be190169d14fc782e9c4abbc6c752174230..049bfbfe3ae932fe888be296145c36cfc76e56a3 100644 --- a/library/Class/WebService/SIGB/Reservation.php +++ b/library/Class/WebService/SIGB/Reservation.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Reservation extends Class_WebService_SIGB_ExemplaireOperation { @@ -24,6 +24,7 @@ class Class_WebService_SIGB_Reservation extends Class_WebService_SIGB_Exemplaire protected $etat; protected $pickup_location_label; + public function getRang() { if (!isset($this->rang)) $this->rang=1; return $this->rang; @@ -32,7 +33,7 @@ class Class_WebService_SIGB_Reservation extends Class_WebService_SIGB_Exemplaire public function setRang($rang) { $this->rang = (int)$rang; - if ($this->rang == 0) + if ($this->rang == 0) $this->rang = 1; return $this; } @@ -48,14 +49,17 @@ class Class_WebService_SIGB_Reservation extends Class_WebService_SIGB_Exemplaire return $this->etat; } + public function setPickupLocationLabel($pickup_location_label) { $this->pickup_location_label = $pickup_location_label; } + public function getPickupLocationLabel() { return $this->pickup_location_label; } + public function onParseAttributes() { $this->setRang($this->getAttribute('Rang')); $this->setEtat($this->getAttribute('Etat')); @@ -63,15 +67,14 @@ class Class_WebService_SIGB_Reservation extends Class_WebService_SIGB_Exemplaire if (!$code_annexe = $this->getAttribute('Lieu')) return; - if ($annexe = Class_CodifAnnexe::getLoader()->findFirstBy(array('code' => $code_annexe))) - $this->setBibliotheque($annexe->getLibelle()); + if ($annexe = Class_CodifAnnexe::findFirstBy(['code' => $code_annexe])) + $this->setBibliotheque($annexe->getLibelle()); } - + /** @codeCoverageIgnore */ public function __toString(){ return parent::__toString().", Rang:".$this->getRang(); } } - -?> \ No newline at end of file +?> diff --git a/scripts/emacs/phafi-mode.el b/scripts/emacs/phafi-mode.el index c54f4c6cf25f2292aa731653c97160891d40d354..3d0b35b7ff86940a648f6fc9e00d31319b7a4f43 100644 --- a/scripts/emacs/phafi-mode.el +++ b/scripts/emacs/phafi-mode.el @@ -93,7 +93,7 @@ (setq ac-sources '(ac-source-gtags ac-source-words-in-buffer ac-source-php-auto-yasnippets)) (imenu-add-menubar-index) (phafi-init-menu) - (phafi-enable-autotest) +;;(phafi-enable-autotest) (setq magit-diff-options '("-w") flymake-mode t diff --git a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php index d1515d1f422c4d7053b2faeb925fffc870f7e828..d6c27d9b87bfa574ab6aec779d946c89f90540b7 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php @@ -298,31 +298,37 @@ class AbonneControllerPretsListReservationTest extends AbstractAbonneControllerP $potter = (new Class_WebService_SIGB_Reservation('12', (new Class_WebService_SIGB_Exemplaire(123))->setTitre('Potter'))) - ->parseExtraAttributes(array('Etat' => 'Réservation émise', - 'Rang' => '2', - 'Bibliotheque' => 'Tombouctou', - 'N° de notice' => 564)); - - Class_Exemplaire::newInstance(['id_origine' => 564, - 'notice' => $this->fixture('Class_Notice', - ['id' => 823, - 'titre_principal' => 'Potter']) - ])->assertSave(); + ->parseExtraAttributes(['Etat' => 'Réservation émise', + 'Rang' => '2', + 'Bibliotheque' => 'Tombouctou', + 'N° de notice' => 564]); // This item has no library: non-regression test. $dobby = (new Class_WebService_SIGB_Reservation('13', (new Class_WebService_SIGB_Exemplaire(124))->setTitre('Dobby'))) - ->parseExtraAttributes(array('Etat' => 'Réservation émise', - 'Rang' => '2', - 'N° de notice' => 565)); + ->parseExtraAttributes(['Etat' => 'Réservation émise', + 'Rang' => '2', + 'N° de notice' => 565]); + + $this->fixture('Class_Notice', + ['id' => 820, + 'titre_principal' => 'Potter']); - Class_Exemplaire::newInstance(['id_origine' => 565, - 'notice' => $this->fixture('Class_Notice', - ['id' => 824, - 'titre_principal' => 'Dobby']) - ])->assertSave(); + $this->fixture('Class_Notice', + ['id' => 824, + 'titre_principal' => 'Dobby']); + $this->fixture('Class_Exemplaire', + ['id' => 120, + 'id_origine' => 564, + 'id_notice' => 820]); + + $this->fixture('Class_Exemplaire', + ['id' => 130, + 'id_origine' => 565, + 'id_notice' => '824', + 'zone995' => '']); $this->florence ->setFicheSigb(['type_comm' => Class_IntBib::COM_OPSYS, @@ -374,7 +380,7 @@ class AbonneControllerPretsListReservationTest extends AbstractAbonneControllerP /** @test */ public function titreShouldBePotterAndLinkToNotice() { - $this->assertXPathContentContains('//tbody/tr[1]//td//a[contains(@href, "recherche/viewnotice/id/823/retour_abonne/reservations")]', + $this->assertXPathContentContains('//tbody/tr[1]//td//a[contains(@href, "recherche/viewnotice/id/820/retour_abonne/reservations")]', 'Potter', $this->_response->getBody()); } diff --git a/tests/library/Class/WebService/SIGB/ExemplaireTest.php b/tests/library/Class/WebService/SIGB/ExemplaireTest.php index 27357a2f11974bcf5d87edaf74441030eb24733a..1894f05fff25e2bd4b7e6acfa8515173ba709554 100644 --- a/tests/library/Class/WebService/SIGB/ExemplaireTest.php +++ b/tests/library/Class/WebService/SIGB/ExemplaireTest.php @@ -16,27 +16,19 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class ExemplaireSIGBTest extends Storm_Test_ModelTestCase { public function setUp() { parent::setUp(); - - $this->profil = new Class_Profil(); - $this->profil - ->setId(4) - ->setCfgNotice(array("exemplaires" => array())); - Class_Profil::setCurrentProfil($this->profil); + Class_Profil::setCurrentProfil($this->fixture('Class_Profil', + ['id' => 4, + 'libelle' => 'default profil'])); $this->ex = new Class_WebService_SIGB_Exemplaire(2); } - public function tearDown() { - $this->profil->setCfgNotice($this->profil->getDefaultValue('cfg_notice')); - parent::tearDown(); - } - /** @test */ public function dispoEnPretShouldBeEnPretByDefault() { @@ -47,8 +39,10 @@ class ExemplaireSIGBTest extends Storm_Test_ModelTestCase { /** @test */ public function dispoEnPretShouldBeEmprunteAsInProfilParams() { - $this->profil - ->setCfgNotice(array("exemplaires" => array('en_pret' => 'Emprunté'))); + $updated_cfg = array_merge(Class_Profil::getCurrentProfil()->getCfgNoticeAsArray(), + ['exemplaires' => ['en_pret' => 'Emprunté']]); + + Class_Profil::getCurrentProfil()->setCfgNotice($updated_cfg); $this->ex->setDisponibiliteEnPret(); $this->assertEquals('Emprunté', $this->ex->getDisponibilite()); diff --git a/tests/library/Class/WebService/SIGB/NanookTest.php b/tests/library/Class/WebService/SIGB/NanookTest.php index 15e2e1cfc17891c6eb68a8d14ac671a516ec5cbd..dbe120805e5812bc3993e18c83f72e4af141c843 100644 --- a/tests/library/Class/WebService/SIGB/NanookTest.php +++ b/tests/library/Class/WebService/SIGB/NanookTest.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ include_once 'NanookFixtures.php'; @@ -171,24 +171,24 @@ class NanookHtmlResponseErrorTest extends NanookServiceErrorTestCase { /** @test */ public function reservationsShouldBeEmpty() { - $this->assertEmpty($this->_emprunteur->getReservations()); + $this->assertEmpty($this->_emprunteur->getReservations()); } /** @test */ public function pretsRetardShouldBeEmpty() { - $this->assertEmpty($this->_emprunteur->getPretsEnRetard()); + $this->assertEmpty($this->_emprunteur->getPretsEnRetard()); } /** @test */ public function empruntsShouldBeEmpty() { - $this->assertEmpty($this->_emprunteur->getEmprunts()); + $this->assertEmpty($this->_emprunteur->getEmprunts()); } /** @test */ public function validShouldBeFalse() { - $this->assertFalse($this->_emprunteur->isValid()); + $this->assertFalse($this->_emprunteur->isValid()); } } @@ -203,7 +203,9 @@ class NanookGetNoticeLiliGrisbiAndCoTest extends NanookTestCase { public function setUp() { parent::setUp(); //Pour avoir les textes de prets par defaut - Class_Profil::getCurrentProfil()->setCfgNotice(array('exemplaires' => array())); + Class_Profil::setCurrentProfil($this->fixture('Class_Profil', + ['id' => 1, + 'libelle' => 'default profil'])); $this->_mock_web_client ->whenCalled('open_url') @@ -408,13 +410,13 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase { /** @test */ public function emprunteurShouldBeValid() { - $this->assertTrue($this->_emprunteur->isValid()); + $this->assertTrue($this->_emprunteur->isValid()); } /** @test */ public function emprunteurPasswordShouldBe2002() { - $this->assertEquals('2002', $this->_emprunteur->getPassword()); + $this->assertEquals('2002', $this->_emprunteur->getPassword()); } @@ -459,7 +461,7 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase { $this->assertEquals('1 rue des fleurs', $this->_emprunteur->getAdresse()); } - + /** @test */ public function codePostalShouldBe74000() { $this->assertEquals('74000', $this->_emprunteur->getCodePostal()); @@ -488,7 +490,7 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase { $this->assertEquals('01 23 45 67 89', $this->_chrystel->getTelephone()); $this->assertEquals('1978-11-10', $this->_chrystel->getNaissance()); } - + /** @test */ public function nbEmpruntsShouldBeThree() { @@ -631,7 +633,7 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase { /** @test */ public function firstReservationEtatShouldBePasDisponibleAvantLe15Juin2012() { - $this->assertEquals('Pas disponible avant le 15/06/2012', + $this->assertEquals('Pas disponible avant le 15/06/2012', $this->_emprunteur->getReservationAt(0)->getEtat()); } @@ -744,7 +746,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase { ->whenCalled('open_url') ->with('http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/1') ->answers(NanookFixtures::xmlGetPatronError()); - + $emprunteur = $this->_service->getEmprunteur($user = Class_Users::newInstance() ->setLogin('90175000410218') ->setPassword('1989')); @@ -755,7 +757,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase { } - + /** @test */ public function withWrongPasswordEmprunteurShouldNotBeValid() { $this->_mock_web_client @@ -766,7 +768,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase { ->whenCalled('open_url') ->with('http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/1') ->answers(NanookFixtures::xmlGetPatronChristelDelpeyroux()); - + $emprunteur = $this->_service->getEmprunteur($user = Class_Users::newInstance() ->setLogin('90175000410218') ->setPassword('1989') @@ -777,7 +779,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase { $this->assertFalse($emprunteur->isValid()); $this->assertEmpty($emprunteur->getPassword()); } - + } @@ -947,13 +949,13 @@ class NanookSaveEmprunteurPostTest extends NanookTestCase { parent::setup(); $this->_mock_web_client ->whenCalled('postData') - ->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1', + ->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1', ['password' => '987654@afi-sa.fr', 'mail' => 'gloas@afi-sa.fr', 'phoneNumber' => '0123456789']) ->answers(NanookFixtures::xmlGetPatronChristelDelpeyrouxAfterPost()) ->beStrict(); - + $this->_crystel = Class_WebService_SIGB_Emprunteur::newInstance(1) ->setPassword('987654@afi-sa.fr') ->setEmail('gloas@afi-sa.fr') @@ -966,7 +968,7 @@ class NanookSaveEmprunteurPostTest extends NanookTestCase { public function christelDelPeyrouxShoudlHaveGloasAsEmail() { $this->assertEquals('gloas@afi-sa.fr', $this->_emprunteur->getEmail()); } - + /** @test **/ public function christelDelPeyrouxShoudlHave0123456789AsTelpehone() { $this->assertEquals('0123456789', $this->_emprunteur->getTelephone()); @@ -992,13 +994,13 @@ class NanookSaveEmprunteurRecordNotFoundTest extends NanookTestCase { parent::setup(); $this->_mock_web_client ->whenCalled('postData') - ->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1', + ->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1', ['password' => '987654@afi-sa.fr', 'mail' => 'gloas@afi-sa.fr', 'phoneNumber' => '0123456789']) ->answers(NanookFixtures::xmlRecordNotFound()) ->beStrict(); - + $this->_crystel = Class_WebService_SIGB_Emprunteur::newInstance(1) ->setPassword('987654@afi-sa.fr') ->setEmail('gloas@afi-sa.fr') @@ -1012,7 +1014,7 @@ class NanookSaveEmprunteurRecordNotFoundTest extends NanookTestCase { public function christelDelPeyrouxShoudlNotBeValidWithRecordNotFoundError() { $this->assertFalse($this->_emprunteur->isValid()); } - + } @@ -1023,13 +1025,13 @@ class NanookSaveEmprunteurUpdatePatronErrorTest extends NanookTestCase { parent::setup(); $this->_mock_web_client ->whenCalled('postData') - ->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1', + ->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1', ['password' => '987654@afi-sa.fr', 'mail' => 'gloas@afi-sa.fr', 'phoneNumber' => '0123456789']) ->answers(NanookFixtures::xmlUpdatePatronError()) ->beStrict(); - + $this->_crystel = Class_WebService_SIGB_Emprunteur::newInstance(1) ->setPassword('987654@afi-sa.fr') ->setEmail('gloas@afi-sa.fr') @@ -1042,7 +1044,5 @@ class NanookSaveEmprunteurUpdatePatronErrorTest extends NanookTestCase { public function christelDelPeyrouxShoudlNotBeValidWithUpdatePatron() { $this->assertFalse($this->_emprunteur->isValid()); } - -} -?> +} diff --git a/tests/library/Class/WebService/SIGB/PergameTest.php b/tests/library/Class/WebService/SIGB/PergameTest.php index 4f217a8d1e58826311b18d32542c78d6e2aa9054..bf02aaf64610899a66f1b5cfc739cfd11eadaed6 100644 --- a/tests/library/Class/WebService/SIGB/PergameTest.php +++ b/tests/library/Class/WebService/SIGB/PergameTest.php @@ -16,131 +16,137 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ abstract class PergameServiceTestCase extends Storm_Test_ModelTestCase { public function setUp() { parent::setUp(); - $this->notice_potter = Class_Notice::getLoader() - ->newInstanceWithId(1) - ->setTitrePrincipal('Harry Potter') - ->setAuteurPrincipal('JK Rowling'); - - $this->potter_annecy = Class_Exemplaire::getLoader() - ->newInstanceWithId(23) - ->setIdNotice(1) - ->setCodeBarres('A-23') - ->setIdOrigine('1HP') - ->setActivite('En rayon - Discotheque') - ->setIdBib(1); - - $this->potter_cran_prete = Class_Exemplaire::getLoader() - ->newInstanceWithId(24) - ->setIdNotice(1) - ->setCodeBarres('C-24') - ->setIdOrigine('1HP') - ->setActivite('En rayon') - ->setIdBib(2); - - $this->potter_cran_reserve = Class_Exemplaire::getLoader() - ->newInstanceWithId(25) - ->setIdNotice(1) - ->setCodeBarres('C-25') - ->setIdOrigine('1HP') - ->setActivite('En rayon') - ->setIdBib(2); - - $this->potter_cran_dispo = Class_Exemplaire::getLoader() - ->newInstanceWithId(26) - ->setIdNotice(1) - ->setCodeBarres('C-26') - ->setIdOrigine('1HP') - ->setActivite('En rayon') - ->setIdBib(2); - - - Class_IntBib::getLoader() - ->newInstanceWithId(1) - ->setCommParams(serialize(array("Autoriser_docs_disponibles" => 1))); - - Class_IntBib::getLoader() - ->newInstanceWithId(2) - ->setCommParams(serialize(array("Autoriser_docs_disponibles" => 0))); - - Class_Bib::getLoader() - ->newInstanceWithId(2) - ->setLibelle('Cran-Gevrier'); - - - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Exemplaire') - ->whenCalled('findFirstBy') - ->with(array('id_bib' => 2, 'code_barres' => 'C-24')) - ->answers($this->potter_cran_prete) - - ->whenCalled('findFirstBy') - ->with(array('id_origine' => '1HP')) - ->answers($this->potter_annecy); - + Class_Profil::setCurrentProfil($this->fixture('Class_Profil', + ['id' => 1, + 'libelle' => 'Pergame FTW'])); + + + $this->fixture('Class_Notice', + ['id' => 5, + 'titre_principal' => 'Trouble maker', + 'auteur_princiapl' => 'pergame']); + + $this->notice_potter = $this->fixture('Class_Notice', + ['id' => 1, + 'titre_principal' => 'Harry Potter', + 'auteur_principal' => 'JK Rowling']); + + $this->potter_annecy = $this->fixture('Class_Exemplaire', + ['id' => 23, + 'id_notice' => 1, + 'code_barres' => 'A-23', + 'id_origine' => '1HP', + 'activite' => 'En rayon - Discotheque', + 'id_bib' => 1]); + + $this->potter_cran_prete = $this->fixture('Class_Exemplaire', + ['id' => 24, + 'id_notice' => 1, + 'code_barres' => 'C-24', + 'id_origine' => '1HP', + 'activite' => 'En prêt', + 'id_bib' => 2]); + + $this->potter_cran_reserve = $this->fixture('Class_Exemplaire', + ['id' => 25, + 'id_notice' => 1, + 'code_barres' => 'C-25', + 'id_origine' => '1HP', + 'activite' => 'En rayon', + 'zone995' => 'I\' from sigb', + 'id_bib' => 2]); + + $this->potter_cran_dispo = $this->fixture('Class_Exemplaire', + ['id' => 26, + 'id_notice' => 1, + 'code_barres' => 'C-26', + 'id_origine' => '1HP', + 'activite' => 'En rayon', + 'id_bib' => 2]); + + $this->fixture('Class_Exemplaire', + ['id' => 27, + 'id_notice' => 5, + 'code_barres' => 'C-24', + 'id_origine' => '1HP', + 'activite' => 'En rayon', + 'id_bib' => 2]); + + + $this->fixture('Class_IntBib', + ['id' => 1]) + ->setCommParams(serialize(["Autoriser_docs_disponibles" => 1])) + ->save(); + + $this->fixture('Class_IntBib', + ['id' => 2]) + ->setCommParams(serialize(['Autoriser_docs_disponibles' => 0])) + ->save(); + + $this->fixture('Class_Bib', + ['id' => 2, + 'libelle' => 'Cran-Gevrier']); $this->_service_cran = Class_WebService_SIGB_Pergame_Service::getService(2); } } + class PergameServiceGetEmprunteurTest extends PergameServiceTestCase { public function setUp() { parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Pret') - ->whenCalled('findAllBy') - ->with(array('IDABON' => 23, 'ORDREABON' => 2, 'EN_COURS' => 1)) - ->answers(array(Class_Pret::getLoader() - ->newInstanceWithId(59) - ->setCodeBarres('C-24') - ->setIdNoticeOrigine(1) - ->setIdPergame('1HP') - ->setEnCours(1) - ->setDateRetour('2010-09-07') - ->setIdSite(2) - ->setIdabon(23) - ->setOrdreabon(2))) - - ->whenCalled('countBy') - ->with(array('ID_NOTICE_ORIGINE' => 1, - 'EN_COURS' => 1)) - ->answers(2); + Class_Notice::beVolatile(); + + $this->fixture('Class_Pret', + ['id' => 59, + 'code_barres' => 'C-24', + 'id_notice_origine' => 1, + 'id_pergame' => '1HP', + 'en_cours' => 1, + 'date_retour' => '2010-09-07', + 'id_site' => 2, + 'idabon' => 23, + 'ordreabon' => 2]); + + $this->fixture('Class_Reservation', + ['id' => 76, + 'id_notice_origine' => '1HP', + 'id_pergame' => '1HP', + 'date_resa' => '2011-12-25', + 'id_site' => 2, + 'idabon' => 23, + 'ordreabon' => 2]); + + $this->fixture('Class_Reservation', + ['id' => 77, + 'id_notice_origine' => '3HP', + 'id_pergame' => '3HP', + 'date_resa' => '2011-12-25', + 'id_site' => 0, + 'idabon' => 23, + 'ordreabon' => 2]); Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Reservation') - ->whenCalled('findAllBy') - ->with(['IDABON' => 23, 'ORDREABON' => 2]) - ->answers([ - Class_Reservation::newInstanceWithId(76, - ['id_notice_origine' => '1HP', - 'id_pergame' => '1HP', - 'date_resa' => '2011-12-25', - 'id_site' => 2, - 'idabon' => 23, - 'ordreabon' => 2]), - - Class_Reservation::newInstanceWithId(77, - ['id_notice_origine' => '3HP', - 'id_pergame' => '3HP', - 'date_resa' => '2011-12-25', - 'id_site' => 0, - 'idabon' => 23, - 'ordreabon' => 2]), - ]) ->whenCalled('countBy') - ->with(['ID_NOTICE_ORIGINE' => 1, + ->with(['ID_NOTICE_ORIGINE' => 1, 'where' => sprintf('DATE_RESA<"%s"', '2011-12-25')]) ->answers(2); - $jc = Class_Users::newInstanceWithId(23, - ['login' => 'jc', - 'idabon' => 23, - 'ordreabon' => 2]); + $jc = $this->fixture('Class_Users', + ['id' => 23, + 'login' => 'jc', + 'password' => 'jc', + 'idabon' => 23, + 'ordreabon' => 2]); $this->emprunteur_jc = $this->_service_cran->getEmprunteur($jc); $this->_first_emprunt = array_first($this->emprunteur_jc->getEmprunts()); @@ -199,7 +205,7 @@ class PergameServiceGetEmprunteurTest extends PergameServiceTestCase { /** @test */ public function firstReservationIdShouldBe76() { $this->assertEquals(76, $this->_first_reservation->getId()); - } + } /** @test */ @@ -231,11 +237,18 @@ class PergameServiceGetEmprunteurTest extends PergameServiceTestCase { $this->assertEquals('Cran-Gevrier', $this->_first_reservation->getBibliotheque()); } + /** @test */ public function secondeReservationBibliothequeShouldBeEmpty() { $resa = $this->emprunteur_jc->getReservations()[1]; $this->assertEmpty($resa->getBibliotheque()); } + + + /** @test */ + public function firstReservationRecordShouldBeHarryPotter() { + $this->assertEquals('Harry Potter', $this->_first_reservation->getNoticeOPAC()->getTitrePrincipal()); + } } @@ -245,57 +258,28 @@ class PergameServiceGetExemplairePotterTest extends PergameServiceTestCase { public function setUp() { parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Exemplaire') - ->whenCalled('findAllBy') - ->with(array('role' => 'notice', - 'model' => $this->notice_potter)) - ->answers(array($this->potter_annecy, - $this->potter_cran_prete, - $this->potter_cran_reserve, $this->potter_cran_dispo)) - - ->whenCalled('findFirstBy') - ->with(array('id_origine' => '1HP', - 'id_bib' => 1)) - ->answers($this->potter_annecy) - - ->whenCalled('findFirstBy') - ->with(array('id_origine' => '1HP', - 'id_bib' => 2)) - ->answers($this->potter_cran_prete); - - - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Pret') - ->whenCalled('findFirstBy') - ->answers(null) - - ->whenCalled('findFirstBy') - ->with(array('id_site' => 2, - 'id_notice_origine' => '1HP', - 'code_barres' => 'C-24', - 'EN_COURS' => 1)) - ->answers(Class_Pret::getLoader() - ->newInstanceWithId(59) - ->setCodeBarres('C-24') - ->setIdNoticeOrigine(1) - ->setIdPergame('1HP') - ->setEnCours(1) - ->setDateRetour('2010-09-07') - ->setIdSite(2)); + $this->fixture('Class_Pret', + ['id' => 59, + 'code_barres' => 'C-24', + 'id_notice_origine' => 1, + 'id_pergame' => '1HP', + 'en_cours' => 1, + 'date_retour' => '2010-09-07', + 'id_site' => 2]); + $this->fixture('Class_Reservation', + ['id' => 34, + 'id_site' => 2, + 'id_notice_origine' => 1]); + + $this->_exemplaire_annecy = + Class_WebService_SIGB_Pergame::getService(['id_bib' => 1]) + ->getExemplaire('1HP', 'A-23'); + + $this->_exemplaire_cran_prete = + Class_WebService_SIGB_Pergame::getService(['id_bib' => 2]) + ->getExemplaire('1HP', 'C-24'); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Reservation') - ->whenCalled('findAllBy') - ->answers(array()) - - ->whenCalled('findAllBy') - ->with(array('id_site' => 2, 'id_notice_origine' => '1HP')) - ->answers(array(Class_Reservation::getLoader() - ->newInstanceWithId(34) - ->setIdSite(2) - ->setIdNoticeOrigine(1))); - - $this->_exemplaire_annecy = Class_WebService_SIGB_Pergame::getService(array('id_bib' => 1))->getExemplaire('1HP', 'A-23'); - $this->_exemplaire_cran_prete = Class_WebService_SIGB_Pergame::getService(array('id_bib' => 2))->getExemplaire('1HP', 'C-24'); $this->_exemplaire_cran_reserve = $this->_service_cran->getExemplaire('1HP', 'C-25'); $this->_exemplaire_cran_dispo = $this->_service_cran->getExemplaire('1HP', 'C-26'); } @@ -414,8 +398,8 @@ class PergameServiceDelegateLegacyTest extends PergameServiceTestCase { ->answers(['statut' => 0, 'erreur' => '']) ->beStrict(); - $result = $this->_service_cran->reserverExemplaire(Class_Users::getIdentity(), - $this->potter_cran_prete, + $result = $this->_service_cran->reserverExemplaire(Class_Users::getIdentity(), + $this->potter_cran_prete, 'CRAN'); $this->assertEquals(['statut' => 0, 'erreur' => ''], $result); }