diff --git a/VERSIONS_HOTLINE/139037 b/VERSIONS_HOTLINE/139037 new file mode 100644 index 0000000000000000000000000000000000000000..9f2a30fb777605475edb478f8a088deee76ae32c --- /dev/null +++ b/VERSIONS_HOTLINE/139037 @@ -0,0 +1 @@ + - ticket #139037 : Gestion des cookies : prendre en compte la personnalisation de tarteaucitron-config.js en mode déconnecté \ No newline at end of file diff --git a/library/Class/Cookies/TarteAuCitron.php b/library/Class/Cookies/TarteAuCitron.php index a2174bb5007985a5bfdfcf54c68b3647df249793..d542f2bfcd3f354c89343dcb051a1784641e4278 100644 --- a/library/Class/Cookies/TarteAuCitron.php +++ b/library/Class/Cookies/TarteAuCitron.php @@ -32,6 +32,7 @@ class Class_Cookies_TarteAuCitron extends Class_Cookies_Base { $customize_js_url = Class_Url::absolute("/public/tarteaucitron-config.js"); $bokeh_js_url = Class_Url::absolute("/public/tarteaucitron-bokeh.js"); + Class_FileManager::beOpenBar(); if ($file = Class_FileManager::file(USERFILES.'/js/tarteaucitron-config.js')) $customize_js_url = $file->getUrl(); diff --git a/tests/application/modules/admin/controllers/IndexControllerTest.php b/tests/application/modules/admin/controllers/IndexControllerTest.php index df84ae729b399df6287902d30d37950808fe1fcd..01b38a31ccfa0d75923d99b2bf9e11648c9781bc 100644 --- a/tests/application/modules/admin/controllers/IndexControllerTest.php +++ b/tests/application/modules/admin/controllers/IndexControllerTest.php @@ -92,11 +92,14 @@ class Admin_IndexControllerCookiesTest extends Admin_IndexControllerTestCase { /** @test */ public function tarteAuCitronCustomJsShouldBeCallToUserfilesIfExists() { - $disk = $this->mock() - ->whenCalled('fileAt') - ->with('userfiles/js/tarteaucitron-config.js') - ->answers($this->mock()->whenCalled('getUrl')->answers('/userfiles/js/tarteaucitron-config.js')); - Class_FileManager::setFileSystem($disk); + ZendAfi_Auth::getInstance()->clearIdentity(); + $this->file_system = $this->mock() + ->whenCalled('fileAt') + ->with('userfiles/js/tarteaucitron-config.js') + ->answers((new Class_FileManager)->setPath('/userfiles/js/tarteaucitron-config.js')) + ->beStrict(); + + Class_FileManager::setFileSystem($this->file_system); $this->dispatch('/admin/index/index', true); $this->assertXPath('//script[contains(@src,"/public/tarteaucitron/tarteaucitron.js")]');