File tree 2 files changed +9
-3
lines changed
test/Bridge/Twig/Extension
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 22
22
"symfony/framework-bundle" : " ^2.7 || ^3.0" ,
23
23
"symfony/twig-bundle" : " ^2.7 || ^3.0" ,
24
24
"symfony/validator" : " ^2.7 || ^3.0" ,
25
- "twig/twig" : " ^1.24"
25
+ "twig/twig" : " ^1.24 || ^2.0 "
26
26
},
27
27
"suggest" : {
28
28
"symfony/form" : " To use enum form type" ,
Original file line number Diff line number Diff line change @@ -33,11 +33,17 @@ protected function setUp()
33
33
34
34
public function testEnvironment ()
35
35
{
36
- $ twig = new \Twig_Environment ();
36
+ $ twig = new \Twig_Environment ($ this -> createMock (\Twig_LoaderInterface::class) );
37
37
$ twig ->addExtension ($ this ->extension );
38
38
39
- $ this ->assertTrue ($ twig ->hasExtension ('greg0ire_enum ' ));
40
39
$ this ->assertInstanceOf (\Twig_SimpleFilter::class, $ twig ->getFilter ('enum_label ' ));
40
+
41
+ if (version_compare (\Twig_Environment::VERSION , '1.26.0 ' ) === -1 ) {
42
+ $ this ->assertTrue ($ twig ->hasExtension ('greg0ire_enum ' ));
43
+
44
+ return ;
45
+ }
46
+ $ this ->assertTrue ($ twig ->hasExtension (EnumExtension::class));
41
47
}
42
48
43
49
/**
You can’t perform that action at this time.
0 commit comments