Add widget directive for Template v2

This commit is contained in:
Kijin Sung 2025-03-20 14:01:56 +09:00
parent 3e052d2d00
commit e192bc0ff6
3 changed files with 22 additions and 7 deletions

View file

@ -1031,6 +1031,11 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
$source = "@url('', 'mid', \$mid, 'act', \$act])";
$target = "<?php echo \$this->config->context === 'HTML' ? getUrl('', 'mid', \$__Context->mid, 'act', \$__Context->act]) : \$this->_v2_escape(getNotEncodedUrl('', 'mid', \$__Context->mid, 'act', \$__Context->act])); ?>";
$this->assertEquals($target, $this->_parse($source));
// Widget
$source = "@widget('login_info', ['skin' => 'default'])";
$target = "<?php echo \WidgetController::getInstance()->execute('login_info', ['skin' => 'default']); ?>";
$this->assertEquals($target, $this->_parse($source));
}
public function testComments()