|
|
@ -91,7 +91,7 @@ class TwigServiceProviderTest extends ServiceProviderTest
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Renderer\TwigServiceProvider::registerTwigEngine
|
|
|
|
* @covers \Engelsystem\Renderer\TwigServiceProvider::registerTwigEngine
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function testRegisterTWigEngine()
|
|
|
|
public function testRegisterTwigEngine()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/** @var TwigEngine|MockObject $htmlEngine */
|
|
|
|
/** @var TwigEngine|MockObject $htmlEngine */
|
|
|
|
$twigEngine = $this->createMock(TwigEngine::class);
|
|
|
|
$twigEngine = $this->createMock(TwigEngine::class);
|
|
|
@ -114,7 +114,7 @@ class TwigServiceProviderTest extends ServiceProviderTest
|
|
|
|
->method('make')
|
|
|
|
->method('make')
|
|
|
|
->withConsecutive(
|
|
|
|
->withConsecutive(
|
|
|
|
[TwigLoader::class, ['paths' => $viewsPath]],
|
|
|
|
[TwigLoader::class, ['paths' => $viewsPath]],
|
|
|
|
[Twig::class],
|
|
|
|
[Twig::class, ['options' => ['cache' => false, 'auto_reload' => true, 'strict_variables' => true]]],
|
|
|
|
[TwigEngine::class]
|
|
|
|
[TwigEngine::class]
|
|
|
|
)->willReturnOnConsecutiveCalls(
|
|
|
|
)->willReturnOnConsecutiveCalls(
|
|
|
|
$twigLoader,
|
|
|
|
$twigLoader,
|
|
|
@ -133,17 +133,17 @@ class TwigServiceProviderTest extends ServiceProviderTest
|
|
|
|
['renderer.twigEngine', $twigEngine]
|
|
|
|
['renderer.twigEngine', $twigEngine]
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$app->expects($this->exactly(2))
|
|
|
|
$app->expects($this->exactly(3))
|
|
|
|
->method('get')
|
|
|
|
->method('get')
|
|
|
|
->withConsecutive(['path.views'], ['config'])
|
|
|
|
->withConsecutive(['path.views'], ['config'], ['path.cache.views'])
|
|
|
|
->willReturnOnConsecutiveCalls($viewsPath, $config);
|
|
|
|
->willReturnOnConsecutiveCalls($viewsPath, $config, 'cache/views');
|
|
|
|
|
|
|
|
|
|
|
|
$this->setExpects($app, 'tag', ['renderer.twigEngine', ['renderer.engine']]);
|
|
|
|
$this->setExpects($app, 'tag', ['renderer.twigEngine', ['renderer.engine']]);
|
|
|
|
|
|
|
|
|
|
|
|
$config->expects($this->once())
|
|
|
|
$config->expects($this->exactly(3))
|
|
|
|
->method('get')
|
|
|
|
->method('get')
|
|
|
|
->with('timezone')
|
|
|
|
->withConsecutive(['environment'], ['environment'], ['timezone'])
|
|
|
|
->willReturn('The/World');
|
|
|
|
->willReturnOnConsecutiveCalls('development', 'development', 'The/World');
|
|
|
|
|
|
|
|
|
|
|
|
$twig->expects($this->once())
|
|
|
|
$twig->expects($this->once())
|
|
|
|
->method('getExtension')
|
|
|
|
->method('getExtension')
|
|
|
|