Fix tests (#250)

This commit is contained in:
Pierre Rudloff 2019-11-28 00:04:05 +01:00
parent aabcee25f0
commit 7772de5394
5 changed files with 23 additions and 5 deletions

View file

@ -6,6 +6,7 @@
namespace Alltube\Test;
use Alltube\LocaleManager;
use Alltube\ViewFactory;
use Slim\Container;
use Slim\Http\Environment;
@ -24,7 +25,9 @@ class ViewFactoryTest extends BaseTest
*/
public function testCreate()
{
$view = ViewFactory::create(new Container());
$container = new Container();
$container['locale'] = LocaleManager::getInstance();
$view = ViewFactory::create($container);
$this->assertInstanceOf(Smarty::class, $view);
}
@ -35,8 +38,10 @@ class ViewFactoryTest extends BaseTest
*/
public function testCreateWithXForwardedProto()
{
$container = new Container();
$container['locale'] = LocaleManager::getInstance();
$request = Request::createFromEnvironment(Environment::mock());
$view = ViewFactory::create(new Container(), $request->withHeader('X-Forwarded-Proto', 'https'));
$view = ViewFactory::create($container, $request->withHeader('X-Forwarded-Proto', 'https'));
$this->assertInstanceOf(Smarty::class, $view);
}
}