Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IntegrationTestCase.php

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\Test

Code

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;
}
RSS feed
Powered by Drupal