From f2785bca0310a973bcb04a0c1cbe56fa5ab95762 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 17 Dec 2020 22:30:19 +0100 Subject: [PATCH] Clear Smarty compiled templates before controller tests In order to avoid permission errors --- tests/ControllerTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index ee3ce16..6229ccf 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -13,6 +13,7 @@ use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; use Alltube\Exception\DependencyException; use Slim\Http\Response; +use Slim\Views\Smarty; use SmartyException; /** @@ -52,6 +53,12 @@ abstract class ControllerTest extends ContainerTest ->setName('locale'); $router->map(['GET'], '/redirect', [$downloadController, 'download']) ->setName('download'); + + /** @var Smarty $view */ + $view = $this->container->get('view'); + + // Make sure we start the tests without compiled templates. + $view->getSmarty()->clearCompiledTemplate(); } /**