From fa12646ead8afe8b4eefded66b763a57b86e9d79 Mon Sep 17 00:00:00 2001 From: philipp lang <philipp@aweos.de> Date: Sat, 29 Mar 2025 02:47:03 +0100 Subject: [PATCH] Add test for filled kontoverbindung --- tests/Unit/Api/PutMemberTest.php | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/Unit/Api/PutMemberTest.php b/tests/Unit/Api/PutMemberTest.php index bfc587e..6fe9129 100644 --- a/tests/Unit/Api/PutMemberTest.php +++ b/tests/Unit/Api/PutMemberTest.php @@ -100,6 +100,39 @@ class PutMemberTest extends TestCase ]); } + public function testItPutsFilledKontoverbindung(): void + { + app(MemberFake::class)->stores(103, 16); + $member = Member::toFactory() + ->withBankAccount(BankAccount::toFactory()->empty()->state([ + 'zahlungsKonditionId' => 1, + 'institut' => 'institut', + 'kontoinhaber' => 'kontoinhaber', + 'kontonummer' => 'kontonummer', + 'bankleitzahl' => 'bankleitzahl', + 'iban' => 'iban', + 'bic' => 'bic', + ])) + ->toMember(['groupId' => 103]); + $response = $this->login()->putMember($member, 78, 79); + + $this->assertEquals(16, $response); + + app(MemberFake::class)->assertStored(103, [ + 'kontoverbindung' => json_encode([ + 'id' => '', + 'zahlungsKonditionId' => 1, + 'mitgliedsNummer' => null, + 'institut' => 'institut', + 'kontoinhaber' => 'kontoinhaber', + 'kontonummer' => 'kontonummer', + 'bankleitzahl' => 'bankleitzahl', + 'iban' => 'iban', + 'bic' => 'bic', + ]), + ]); + } + public function testUpdateAMemberWithForeignAttributes(): void { app(MemberFake::class)