Add test for filled kontoverbindung

This commit is contained in:
philipp lang 2025-03-29 02:47:03 +01:00
parent 1fe8ba8cf9
commit fa12646ead
1 changed files with 33 additions and 0 deletions
tests/Unit/Api

View File

@ -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)