Clear Smarty compiled templates before controller tests

In order to avoid permission errors
This commit is contained in:
Pierre Rudloff 2020-12-17 22:30:19 +01:00
parent 9921b6210f
commit f2785bca03

View file

@ -13,6 +13,7 @@ use Alltube\Controller\FrontController;
use Alltube\Exception\ConfigException; use Alltube\Exception\ConfigException;
use Alltube\Exception\DependencyException; use Alltube\Exception\DependencyException;
use Slim\Http\Response; use Slim\Http\Response;
use Slim\Views\Smarty;
use SmartyException; use SmartyException;
/** /**
@ -52,6 +53,12 @@ abstract class ControllerTest extends ContainerTest
->setName('locale'); ->setName('locale');
$router->map(['GET'], '/redirect', [$downloadController, 'download']) $router->map(['GET'], '/redirect', [$downloadController, 'download'])
->setName('download'); ->setName('download');
/** @var Smarty $view */
$view = $this->container->get('view');
// Make sure we start the tests without compiled templates.
$view->getSmarty()->clearCompiledTemplate();
} }
/** /**