diff --git a/src/LiveComponent/src/Test/TestLiveComponent.php b/src/LiveComponent/src/Test/TestLiveComponent.php index 212d5b962b6..45cce6c2822 100644 --- a/src/LiveComponent/src/Test/TestLiveComponent.php +++ b/src/LiveComponent/src/Test/TestLiveComponent.php @@ -40,6 +40,8 @@ public function __construct( ) { $this->client->catchExceptions(false); + $data['attributes']['data-live-id'] ??= 'in-a-real-scenario-it-would-already-have-one---provide-one-yourself-if-needed'; + $mounted = $this->factory->create($this->metadata->getName(), $data); $props = $this->hydrator->dehydrate( $mounted->getComponent(), diff --git a/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php b/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php index 0216a4fa29b..4e57d2682e1 100644 --- a/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php +++ b/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php @@ -290,7 +290,7 @@ public function testItUseBlocksFromEmbeddedContextUsingMultipleComponents(): voi }) ->post('/_components/component2/increase', [ 'headers' => ['X-CSRF-TOKEN' => $token], - 'body' => json_encode(['props' => $dehydrated->getProps()]), + 'body' => ['data' => json_encode(['props' => $dehydrated->getProps()])], ]) ->assertSuccessful() ->assertHeaderContains('Content-Type', 'html')