Skip to content
Snippets Groups Projects
Commit 84c9317e authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT
Browse files

hotline#108763 : OPAC user account issues was not displayed for ILS Pergame

parent b5187a44
Branches
Tags
3 merge requests!3503Hotline,!3502Hotline,!3497hotline#108763 : OPAC user account issues was not displayed for ILS Pergame
Pipeline #10013 passed with stage
in 44 minutes and 50 seconds
- ticket #108763 : SIGB Pergame : Les prêts compte lecteur ne s'affichaient plus
\ No newline at end of file
......@@ -1945,6 +1945,9 @@ class Class_Users extends Storm_Model_Abstract {
public function updateFromPatron() {
if (! $this->getSIGBComm() || !$this->getSIGBComm()->providesAuthentication())
return $this;
if (!$borrower = $this->getEmprunteur())
return $this;
......
......@@ -32,9 +32,21 @@ abstract class PergameServiceTestCase extends ModelTestCase {
'login' => 'gaz',
'password' => 'toto',
'idabon' => 'A-01',
'id_sigb' => '3000',
'id_int_bib' => 2,
'id_site' => 2,
'ordreabon' => 2]);
$this->pergame = new Class_Systeme_PergameService($user);
$data = 'a:8:{s:26:"Autoriser_docs_disponibles";s:1:"1";s:13:"Max_par_carte";s:1:"3";s:16:"Max_par_document";s:1:"4";s:23:"Autoriser_prolongations";s:0:"";s:24:"Interdire_si_reservation";s:0:"";s:23:"Nombre_max_par_document";s:0:"";s:14:"Duree_en_jours";s:0:"";s:24:"Anteriorite_max_en_jours";s:0:"";}';
$this->mock_sql
->whenCalled('fetchOne')
->answers($data);
$this->fixture('Class_IntBib', ['id' => 2, 'comm_params'=> $data, 'comm_sigb' => Class_IntBib::SIGB_PERGAME]);
$this->time_source = new PergameServiceTestingTimeSource();
Class_Systeme_PergameService::setTimeSource($this->time_source);
}
......@@ -97,6 +109,12 @@ class PergameServiceUserTest extends PergameServiceTestCase {
}
/** @test */
public function updateFromPatronShouldNotUpdateUser() {
$this->assertEquals('A-01', Class_Users::find(3)->updateFromPatron()->getIdabon());
}
/** @test */
public function getReservationsShouldReturnResa() {
$this->assertEquals([], $this->pergame->getReservations());
......
......@@ -39,7 +39,8 @@ abstract class Scenario_AbonneMultiCardsTestCase extends AbstractControllerTestC
'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB,
'idabon' => '12345',
'date_fin' => '2016-12-25',
'bib' => $death_star]);
'bib' => $death_star,
]);
$e_wok = $this->fixture('Class_Users',
['id' => 666,
......@@ -56,7 +57,8 @@ abstract class Scenario_AbonneMultiCardsTestCase extends AbstractControllerTestC
'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB,
'idabon' => '6789',
'date_fin' => '2016-11-01',
'bib' => $death_star]);
'bib' => $death_star
]);
Class_Users::clearCache();
}
......@@ -444,10 +446,17 @@ abstract class Scenario_AbonneMultiCardsAccountOfEwokTestCase extends Scenario_A
public function setUp() {
parent::setUp();
Class_CommSigb::setInstance($this->_comm = $this->mock());
Class_CommSigb::setInstance($this->_comm = $this->mock()
->whenCalled('providesAuthentication')
->answers(true));
ZendAfi_Auth::getInstance()->logUser(Class_Users::find(666));
$int_death_star = $this->fixture('Class_IntBib', ['id' => 23, 'comm_params'=> ['url_serveur' => 'http://localhost:8080'], 'comm_sigb' => Class_IntBib::COM_NANOOK]);
Class_Users::find(666)->setIntBib($int_death_star)->save();
Class_Users::find(2)->setIntBib($int_death_star)->save();
$potter = new Class_WebService_SIGB_Emprunt('12', new Class_WebService_SIGB_Exemplaire(123));
$potter
->setDateRetour('01/01/1974')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment