Skip to content

Commit

Permalink
fix: use concrete class (instead of anon) for test
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Jan 2, 2024
1 parent 95e5be8 commit e9046f2
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -1643,3 +1639,10 @@ public function __construct(
) {
}
}

class DummyObjectWithObjects
{
#[LiveProp()]
/** @var ProductFixtureEntity[] */
public array $products = [];
}

0 comments on commit e9046f2

Please sign in to comment.