Skip to content

Commit 41a53d5

Browse files
committed
bug #1371 fix: use concrete class (instead of anon) for test (kbond)
This PR was merged into the 2.x branch. Discussion ---------- fix: use concrete class (instead of anon) for test | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Issues | #1369 | License | MIT `symfony/property-accessor` doesn't appear to parse object types from anon class props when imported. This is a quick fix to get the CI passing. Commits ------- e9046f2 fix: use concrete class (instead of anon) for test
2 parents 95e5be8 + e9046f2 commit 41a53d5

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)