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' => [
'blocks' => [
'block' => [
'component' => 'SomeTwigComponent',
'context' => [
'baz' => 'qux',
'component' => [
'name' => 'SomeTwigComponent',
'inputs' => [
'context' => 'expr:context',
],
],
],
],

View file

@ -114,7 +114,7 @@ final class TemplateEventTest extends KernelTestCase
'<!-- BEGIN EVENT | event name: "template_event_with_context" -->',
'<!-- BEGIN BLOCK | event name: "template_event_with_context", block name: "block", component: "SomeTwigComponent", priority: 0 -->',
'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 EVENT | event name: "template_event_with_context" -->',
];

View file

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