From 22b4f8ed51b8b4f2f9e39fe1cb2b0b4cf150a758 Mon Sep 17 00:00:00 2001 From: Nicolas PHILIPPE Date: Wed, 6 Nov 2024 21:43:28 +0100 Subject: [PATCH] test: add failing test case for proxy and association --- .../ORM/ProxyEntityFactoryRelationshipTestCase.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Integration/ORM/ProxyEntityFactoryRelationshipTestCase.php b/tests/Integration/ORM/ProxyEntityFactoryRelationshipTestCase.php index 400d777b..2486ecf8 100644 --- a/tests/Integration/ORM/ProxyEntityFactoryRelationshipTestCase.php +++ b/tests/Integration/ORM/ProxyEntityFactoryRelationshipTestCase.php @@ -134,4 +134,16 @@ public function cannot_use_assert_persisted_when_entity_has_changes(): void $this->expectException(RefreshObjectFailed::class); $contact->_assertPersisted(); } + + /** + * @test + */ + public function can_add_and_save_association(): void + { + $category = $this->categoryFactory()->create(); + + $contact = $this->contactFactory()->withoutPersisting()->create(); + $category->addContact($contact->_real()); + $category->_save(); + } }