diff --git a/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php b/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php index 433ea31d809..4bb60d8266b 100644 --- a/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php +++ b/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php @@ -750,11 +750,7 @@ public function onEntireEntityUpdated($oldValue) $prod2 = new ProductFixtureEntity(); $prod3 = create(ProductFixtureEntity::class, ['name' => 'item3'])->object(); - return HydrationTest::create(new class() { - #[LiveProp()] - /** @var \Symfony\UX\LiveComponent\Tests\Fixtures\Entity\ProductFixtureEntity[] */ - public array $products = []; - }) + return HydrationTest::create(new DummyObjectWithObjects()) ->mountWith(['products' => [$prod1, $prod2, $prod3]]) ->assertDehydratesTo([ 'products' => [$prod1->id, [], $prod3->id], @@ -1643,3 +1639,10 @@ public function __construct( ) { } } + +class DummyObjectWithObjects +{ + #[LiveProp()] + /** @var ProductFixtureEntity[] */ + public array $products = []; +}