Disable all conversion inside verbatim section of template v2

This commit is contained in:
Kijin Sung 2025-08-18 22:24:48 +09:00
parent f7543e4c9a
commit 451d0b95ac
2 changed files with 35 additions and 1 deletions

View file

@ -1115,6 +1115,40 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
'',
]);
$this->assertEquals($target, $this->_parse($source));
// @verbatim block inside @php block
$source = implode("\n", [
'@php',
'@verbatim',
'$foo = $bar->$baz;',
'@endverbatim',
'@endphp',
]);
$target = implode("\n", [
'<?php',
'',
'$foo = $bar->$baz;',
'',
'?>',
]);
$this->assertEquals($target, $this->_parse($source));
// @php block inside @verbatim block
$source = implode("\n", [
'@verbatim',
'@php',
'$foo = $bar->$baz;',
'@endphp',
'@endverbatim',
]);
$target = implode("\n", [
'',
'@php',
'$foo = $bar->$baz;',
'@endphp',
'',
]);
$this->assertEquals($target, $this->_parse($source));
}
public function testRawPhpCode()