1 | <?php |
||
13 | class TwigResponderConfigurationTest extends TestCase |
||
14 | { |
||
15 | public function testApply() |
||
16 | { |
||
17 | $injector = new Injector; |
||
18 | |||
19 | $auryn = new AurynConfiguration(); |
||
20 | $auryn->apply($injector); |
||
21 | |||
22 | $config = $injector->make(TwigResponderConfiguration::class); |
||
23 | $config->apply($injector); |
||
24 | |||
25 | $responder = $injector->make(FormattedResponder::class); |
||
26 | |||
27 | $this->assertArrayHasKey(TwigFormatter::class, $responder); |
||
28 | $this->assertSame(1.0, $responder[TwigFormatter::class]); |
||
29 | } |
||
30 | |||
31 | public function testEnvironmentVariables() |
||
32 | { |
||
33 | $envVariables = [ |
||
34 | 'TWIG_FILE_EXTENSIONS' => 'html.twig,twig' |
||
35 | ]; |
||
36 | |||
37 | $injector = new Injector; |
||
38 | $injector->prepare(Env::class, function (Env $env) use ($envVariables) { |
||
39 | return $env->withValues($envVariables); |
||
40 | }); |
||
41 | |||
42 | $config = $injector->make(TwigResponderConfiguration::class); |
||
43 | $config->apply($injector); |
||
44 | } |
||
45 | } |
||
46 |