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

hotline MT #141556 fix borrower cache deletion

parent 23898c16
Branches
Tags
1 merge request!4263Hotline#141556 reservation probleme avec le cache
Pipeline #15155 passed with stage
in 26 minutes and 10 seconds
- ticket #141556 : Magasin de thèmes : Correction de l'invalidation du cache du compte abonné.
\ No newline at end of file
......@@ -77,9 +77,13 @@ class AbonneController extends ZendAfi_Controller_Action {
protected function clearEmprunteurCache() {
$no_cache_actions = Class_Template::current()->isLegacy()
? ['prets', 'reservations', 'fiche', 'loans-history', 'ajax-loans', 'suggestions']
: ['fiche', 'loans-history', 'ajax-loans', 'suggestions'];
$no_cache_actions =
['fiche',
'prets',
'reservations',
'loans-history',
'ajax-loans',
'suggestions'];
if (!in_array($this->getRequest()->getActionName(),
$no_cache_actions))
......
......@@ -1519,4 +1519,127 @@ class TemplatesAbonneKohaAjaxLoansTest extends AbstractControllerTestCase {
public function shouldRenderEmptyBodyWithoutFatalError() {
$this->assertEmpty($this->_response->getBody());
}
}
abstract class TemplatesAbonneCacheTestCase extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp(){
parent::setUp();
$this->_buildTemplateProfil(['id' => 8932]);
$int_bib = $this->fixture(Class_IntBib::class,
['id' => 1,
'comm_sigb' => Class_IntBib::COM_NANOOK,
'comm_params' => ['url_serveur' => 'http://localhost']]);
$user = $this->fixture(Class_Users::class,
['id' => 3,
'login' => 'patron',
'password' => 'patron',
'id_int_bib' => 1,
'id_site' => 1,
'idabon' => '007',
'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB]);
$cache = $this
->mock()
->whenCalled('remove')
->answers(true)
->whenCalled('test')
->answers(false)
->whenCalled('save')
->answers(true);
Storm_Cache::setDefaultZendCache($cache);
ZendAfi_Auth::getInstance()->logUser($user);
}
public function tearDown() {
Storm_Cache::setDefaultZendCache(null);
parent::tearDown();
}
/** @test */
public function removeCacheShouldHaveBeenCalled() {
$this->assertTrue(Storm_cache::getDefaultZendCache()->methodHasBeenCalled('remove'));
}
}
class TemplatesAbonneCacheReservationsTest extends TemplatesAbonneCacheTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/abonne/reservations');
}
}
class TemplatesAbonneCacheFicheTest extends TemplatesAbonneCacheTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/abonne/fiche');
}
}
class TemplatesAbonneCachePretsTest extends TemplatesAbonneCacheTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/abonne/prets');
}
}
class TemplatesAbonneCacheLoansHistoryTest extends TemplatesAbonneCacheTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/abonne/loans-history');
}
}
class TemplatesAbonneCacheAjaxLoansTest extends TemplatesAbonneCacheTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/abonne/ajax-loans');
}
}
class TemplatesAbonneCacheSuggestionsTest extends TemplatesAbonneCacheTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/abonne/suggestions');
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment