laravel-nami-api/tests/Unit/PushMemberTest.php

51 lines
1.5 KiB
PHP
Raw Normal View History

2020-07-15 22:55:52 +02:00
<?php
namespace Zoomyboy\LaravelNami\Tests\Unit;
2023-02-02 16:32:08 +01:00
use Zoomyboy\LaravelNami\Data\Member;
use Zoomyboy\LaravelNami\Fakes\MemberFake;
2022-02-11 00:14:48 +01:00
use Zoomyboy\LaravelNami\Tests\TestCase;
2020-07-15 22:55:52 +02:00
2021-04-11 16:58:10 +02:00
class PushMemberTest extends TestCase
2020-07-15 22:55:52 +02:00
{
2023-02-02 16:32:08 +01:00
public function testPushASingleMember(): void
{
app(MemberFake::class)->createsSuccessfully(103, 16);
$response = $this->login()->putMember(Member::from([
2020-07-15 22:55:52 +02:00
'firstname' => 'Max',
'lastname' => 'Nach1',
'nickname' => 'spitz1',
2023-02-02 16:32:08 +01:00
'groupId' => 103,
'genderId' => 17,
'confessionId' => 33,
'joinedAt' => '2021-02-02 00:00:00',
'birthday' => '2021-02-02 00:00:00',
'email' => 'aa@b.de',
'countryId' => 78,
'keepdata' => false,
'sendNewspaper' => false,
'regionId' => 11,
'nationalityId' => 12,
'beitragsartId' => null,
]));
$this->assertEquals(16, $response);
app(MemberFake::class)->assertCreated(103, [
'spitzname' => 'spitz1',
'vorname' => 'Max',
'nachname' => 'Nach1',
'geschlechtId' => 17,
'email' => 'aa@b.de',
'beitragsartId' => null,
'geburtsDatum' => '2021-02-02 00:00:00',
'konfessionId' => 33,
'landId' => 78,
'wiederverwendenFlag' => false,
'zeitschriftenversand' => false,
'regionId' => 11,
'staatsangehoerigkeitId' => 12,
2022-02-18 18:29:02 +01:00
]);
2020-07-15 22:55:52 +02:00
}
}