Use cleaner way to create custom config everywhere

This commit is contained in:
Pierre Rudloff 2017-04-24 18:07:59 +02:00
parent e4f061e6c3
commit d2ad962f6f
2 changed files with 20 additions and 16 deletions

View file

@ -83,6 +83,17 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase
Config::destroyInstance();
}
/**
* Test the constructor.
*
* @return void
*/
public function testConstructor()
{
$controller = new FrontController($this->container);
$this->assertInstanceOf(FrontController::class, $controller);
}
/**
* Test the constructor with streams enabled.
*
@ -325,10 +336,7 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase
*/
public function testRedirectWithM3uStream()
{
$config = Config::getInstance();
$config->stream = true;
//We need to create a new controller instance in order to apply the custom config
$controller = new FrontController($this->container);
$controller = new FrontController($this->container, new Config(['stream'=>true]));
$result = $controller->redirect(
$this->request->withQueryParams(['url'=>'https://twitter.com/verge/status/813055465324056576/video/1']),
$this->response