From 5928cb71aef09aaec624842d9910b7f30a891ed2 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 18 Apr 2013 17:11:35 +0200 Subject: [PATCH] Fix unit tests --- lib/Alchemy/Phrasea/Application.php | 8 ++++++++ templates/web/common/thumbnail.html.twig | 2 +- tests/Alchemy/Tests/Phrasea/Border/FileTest.php | 15 ++++++++++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index 74f12b394a..03318b7ea6 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -326,6 +326,7 @@ class Application extends SilexApplication // symfony locale is set on 16 priority, let's override it $this['dispatcher']->addListener(KernelEvents::REQUEST, array($this, 'addLocale'), 17); $this['dispatcher']->addListener(KernelEvents::REQUEST, array($this, 'addLocale'), 15); + $this['dispatcher']->addListener(KernelEvents::REQUEST, array($this, 'removePhraseanetLocale'), 14); $this['dispatcher']->addListener(KernelEvents::REQUEST, array($this, 'initSession'), 254); $this['dispatcher']->addListener(KernelEvents::RESPONSE, array($this, 'addUTF8Charset'), -128); @@ -426,6 +427,13 @@ class Application extends SilexApplication $event->setResponse($response); } + public function removePhraseanetLocale(GetResponseEvent $event) + { + if (isset($this['phraseanet.locale'])) { + unset($this['phraseanet.locale']); + } + } + public function addLocale(GetResponseEvent $event) { if (isset($this['phraseanet.locale'])) { diff --git a/templates/web/common/thumbnail.html.twig b/templates/web/common/thumbnail.html.twig index 1646171024..5255400833 100644 --- a/templates/web/common/thumbnail.html.twig +++ b/templates/web/common/thumbnail.html.twig @@ -60,7 +60,7 @@