Commit d4980159 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3194003 by Gábor Hojtsy, lauriii: Second, third, etc. twig issues...

Issue #3194003 by Gábor Hojtsy, lauriii: Second, third, etc. twig issues overwrite the previous twig issue found
parent 0f953a34
......@@ -296,11 +296,9 @@ final class DeprecationAnalyzer {
preg_match('/\s(\d).?$/', $twig_deprecation, $line_matches);
$twig_deprecation = preg_replace('! in (.+)\.twig at line \d+\.!', '.', $twig_deprecation);
$twig_deprecation .= ' See https://drupal.org/node/3071078.';
$result['data']['files'][$file_matches[1]]['messages'] = [
[
'message' => $twig_deprecation,
'line' => $line_matches[1] ?: 0,
],
$result['data']['files'][$file_matches[1]]['messages'][] = [
'message' => $twig_deprecation,
'line' => $line_matches[1] ?: 0,
];
$result['data']['totals']['errors']++;
$result['data']['totals']['file_errors']++;
......
......@@ -73,12 +73,14 @@ class UpgradeStatusAnalyzeTest extends UpgradeStatusTestBase {
$report = $key_value->get('upgrade_status_test_theme');
$this->assertNotEmpty($report);
$this->assertEquals(4, $report['data']['totals']['file_errors']);
$this->assertEquals(5, $report['data']['totals']['file_errors']);
$this->assertCount(3, $report['data']['files']);
$file = reset($report['data']['files']);
$message = $file['messages'][0];
$this->assertEquals('Twig Tag "raw" is deprecated since version 1.21. Use "verbatim" instead. See https://drupal.org/node/3071078.', $message['message']);
$this->assertEquals(1, $message['line']);
foreach ([0 => 1, 1 => 4] as $index => $line) {
$message = $file['messages'][$index];
$this->assertEquals('Twig Tag "raw" is deprecated since version 1.21. Use "verbatim" instead. See https://drupal.org/node/3071078.', $message['message']);
$this->assertEquals($line, $message['line']);
}
$file = next($report['data']['files']);
$this->assertEquals('Theme is overriding a deprecated library. The "upgrade_status_test_library/deprecated_library" asset library is deprecated for testing.', $file['messages'][0]['message']);
$this->assertEquals(0, $file['messages'][0]['line']);
......
{% raw %}
Kitten
{% endraw %}
{% raw %}
Panda
{% endraw %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment