Skip to content

Commit e9046f2

Browse files
committed
fix: use concrete class (instead of anon) for test
1 parent 95e5be8 commit e9046f2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,7 @@ public function onEntireEntityUpdated($oldValue)
750750
$prod2 = new ProductFixtureEntity();
751751
$prod3 = create(ProductFixtureEntity::class, ['name' => 'item3'])->object();
752752

753-
return HydrationTest::create(new class() {
754-
#[LiveProp()]
755-
/** @var \Symfony\UX\LiveComponent\Tests\Fixtures\Entity\ProductFixtureEntity[] */
756-
public array $products = [];
757-
})
753+
return HydrationTest::create(new DummyObjectWithObjects())
758754
->mountWith(['products' => [$prod1, $prod2, $prod3]])
759755
->assertDehydratesTo([
760756
'products' => [$prod1->id, [], $prod3->id],
@@ -1643,3 +1639,10 @@ public function __construct(
16431639
) {
16441640
}
16451641
}
1642+
1643+
class DummyObjectWithObjects
1644+
{
1645+
#[LiveProp()]
1646+
/** @var ProductFixtureEntity[] */
1647+
public array $products = [];
1648+
}

0 commit comments

Comments
 (0)