More test coverage

Run youtube-dl with --restrict-filenames in order to avoid issues when testing against different locales
This commit is contained in:
Pierre Rudloff 2017-05-31 00:48:50 +02:00
parent 419110f764
commit 0a66dce2b8
7 changed files with 190 additions and 29 deletions

View file

@ -7,6 +7,8 @@ namespace Alltube\Test;
use Alltube\ViewFactory;
use Slim\Container;
use Slim\Http\Environment;
use Slim\Http\Request;
use Slim\Views\Smarty;
/**
@ -24,4 +26,17 @@ class ViewFactoryTest extends \PHPUnit_Framework_TestCase
$view = ViewFactory::create(new Container());
$this->assertInstanceOf(Smarty::class, $view);
}
/**
* Test the create() function with a X-Forwarded-Proto header.
*
* @return void
*/
public function testCreateWithXForwardedProto()
{
$request = Request::createFromEnvironment(Environment::mock());
$view = ViewFactory::create(new Container(), $request->withHeader('X-Forwarded-Proto', 'https'));
$this->assertInstanceOf(Smarty::class, $view);
}
}