Fix FrontController tests
This commit is contained in:
parent
4aba4d5bfd
commit
419110f764
2 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
{locale path="../i18n" domain="Alltube"}
|
||||
<!Doctype HTML>
|
||||
<html lang="{$locale->getBcp47()}">
|
||||
<html {if isset($locale)}lang="{$locale->getBcp47()}"{/if}>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name=viewport content="width=device-width, initial-scale=1">
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace Alltube\Test;
|
|||
|
||||
use Alltube\Config;
|
||||
use Alltube\Controller\FrontController;
|
||||
use Alltube\LocaleManager;
|
||||
use Alltube\ViewFactory;
|
||||
use Slim\Container;
|
||||
use Slim\Http\Environment;
|
||||
|
@ -55,6 +56,7 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase
|
|||
$this->request = Request::createFromEnvironment(Environment::mock());
|
||||
$this->response = new Response();
|
||||
$this->container['view'] = ViewFactory::create($this->container, $this->request);
|
||||
$this->container['locale'] = new LocaleManager();
|
||||
$this->controller = new FrontController($this->container, Config::getInstance('config/config_test.yml'));
|
||||
$this->container['router']->map(['GET'], '/', [$this->controller, 'index'])
|
||||
->setName('index');
|
||||
|
@ -64,6 +66,8 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase
|
|||
->setName('extractors');
|
||||
$this->container['router']->map(['GET'], '/redirect', [$this->controller, 'redirect'])
|
||||
->setName('redirect');
|
||||
$this->container['router']->map(['GET'], '/locale', [$this->controller, 'locale'])
|
||||
->setName('locale');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue