Fix Component renderer

This commit is contained in:
Jacob Tobiasz 2024-01-04 19:16:40 +01:00
parent 99e42afaa2
commit 4a68046178
No known key found for this signature in database
GPG key ID: 3F84290201B006E0
3 changed files with 8 additions and 6 deletions

View file

@ -132,9 +132,11 @@ final class Kernel extends HttpKernel
'template_event_with_context' => [ 'template_event_with_context' => [
'blocks' => [ 'blocks' => [
'block' => [ 'block' => [
'component' => 'SomeTwigComponent', 'component' => [
'context' => [ 'name' => 'SomeTwigComponent',
'baz' => 'qux', 'inputs' => [
'context' => 'expr:context',
],
], ],
], ],
], ],

View file

@ -114,7 +114,7 @@ final class TemplateEventTest extends KernelTestCase
'<!-- BEGIN EVENT | event name: "template_event_with_context" -->', '<!-- BEGIN EVENT | event name: "template_event_with_context" -->',
'<!-- BEGIN BLOCK | event name: "template_event_with_context", block name: "block", component: "SomeTwigComponent", priority: 0 -->', '<!-- BEGIN BLOCK | event name: "template_event_with_context", block name: "block", component: "SomeTwigComponent", priority: 0 -->',
'Hello from the Twig Component :)', 'Hello from the Twig Component :)',
'Context: baz=qux, foo=bar', 'Context: foo=bar',
'<!-- END BLOCK | event name: "template_event_with_context", block name: "block" -->', '<!-- END BLOCK | event name: "template_event_with_context", block name: "block" -->',
'<!-- END EVENT | event name: "template_event_with_context" -->', '<!-- END EVENT | event name: "template_event_with_context" -->',
]; ];

View file

@ -64,7 +64,7 @@ final class TwigComponentBlockRendererSpec extends ObjectBehavior
'Component', 'Component',
[ [
'foo' => 'bar', 'foo' => 'bar',
'bar' => 'expr:foo', 'bar' => 'expr:baz',
'nested' => [ 'nested' => [
'foo' => 'expr:bar', 'foo' => 'expr:bar',
'bar' => 'expr:baz', 'bar' => 'expr:baz',
@ -90,7 +90,7 @@ final class TwigComponentBlockRendererSpec extends ObjectBehavior
$componentRenderer $componentRenderer
->createAndRender('Component', [ ->createAndRender('Component', [
'foo' => 'bar', 'foo' => 'bar',
'bar' => 'bar', 'bar' => 'qux',
'nested' => [ 'nested' => [
'foo' => 'baz', 'foo' => 'baz',
'bar' => 'qux', 'bar' => 'qux',