function IntegrationTestCase::parseTemplates
1 call to IntegrationTestCase::parseTemplates()
- IntegrationTestCase::getTests in vendor/
twig/ twig/ src/ Test/ IntegrationTestCase.php - @final since Twig 3.13
File
-
vendor/
twig/ twig/ src/ Test/ IntegrationTestCase.php, line 278
Class
- IntegrationTestCase
- Integration test helper.
Namespace
Twig\TestCode
protected static function parseTemplates($test) {
$templates = [];
preg_match_all('/--TEMPLATE(?:\\((.*?)\\))?--(.*?)(?=\\-\\-TEMPLATE|$)/s', $test, $matches, \PREG_SET_ORDER);
foreach ($matches as $match) {
$templates[$match[1] ?: 'index.twig'] = $match[2];
}
return $templates;
}