|
44 | 44 | use Symfony\UX\LiveComponent\Tests\Fixtures\Enum\IntEnum; |
45 | 45 | use Symfony\UX\LiveComponent\Tests\Fixtures\Enum\StringEnum; |
46 | 46 | use Symfony\UX\LiveComponent\Tests\Fixtures\Enum\ZeroIntEnum; |
| 47 | +use Symfony\UX\LiveComponent\Tests\Fixtures\Factory\ProductFixtureEntityFactory; |
47 | 48 | use Symfony\UX\LiveComponent\Tests\LiveComponentTestHelper; |
48 | 49 | use Symfony\UX\TwigComponent\ComponentAttributes; |
49 | 50 | use Symfony\UX\TwigComponent\ComponentMetadata; |
|
53 | 54 | use Zenstruck\Foundry\Test\ResetDatabase; |
54 | 55 |
|
55 | 56 | use function Zenstruck\Foundry\object; |
| 57 | +use function Zenstruck\Foundry\Persistence\delete; |
56 | 58 | use function Zenstruck\Foundry\Persistence\persist; |
57 | | -use function Zenstruck\Foundry\Persistence\proxy; |
58 | 59 |
|
59 | 60 | /** |
60 | 61 | * @author Kevin Bond <[email protected]> |
@@ -434,16 +435,16 @@ public function onEntireEntityUpdated($oldValue) |
434 | 435 | }]; |
435 | 436 |
|
436 | 437 | yield 'Persisted entity: deleting entity between dehydration and hydration sets it to null' => [function () { |
437 | | - $product = proxy(persist(ProductFixtureEntity::class)); |
| 438 | + $product = ProductFixtureEntityFactory::createOne(); |
438 | 439 |
|
439 | 440 | return HydrationTest::create(new class { |
440 | 441 | // test that event the writable path doesn't cause problems |
441 | 442 | #[LiveProp(writable: ['name'])] |
442 | 443 | public ?ProductFixtureEntity $product; |
443 | 444 | }) |
444 | | - ->mountWith(['product' => $product->_real()]) |
| 445 | + ->mountWith(['product' => $product]) |
445 | 446 | ->beforeHydration(function () use ($product) { |
446 | | - $product->_delete(); |
| 447 | + delete($product); |
447 | 448 | }) |
448 | 449 | ->assertObjectAfterHydration(function (object $object) { |
449 | 450 | self::assertNull( |
|
0 commit comments