$extractor =
new TwigExtractor($twig);
$catalogue =
new MessageCatalogue('en'
);
$extractor->
extract($resources,
$catalogue);
$this->
assertSame($messages,
$catalogue->
all());
} public static function resourcesWithSyntaxErrorsProvider(): array
{ return [ [__DIR__.'/../Fixtures',
['messages' =>
['Hi!' => 'Hi!'
]]],
[__DIR__.'/../Fixtures/extractor/syntax_error.twig',
[]],
[new \
SplFileInfo(__DIR__.'/../Fixtures/extractor/syntax_error.twig'
),
[]],
];
} /**
* @dataProvider resourceProvider
*/
public function testExtractWithFiles($resource) { $loader =
new ArrayLoader([]);
$twig =
new Environment($loader,
[ 'strict_variables' => true,