Mod member fake

This commit is contained in:
philipp lang 2024-03-09 00:13:01 +01:00
parent dfd3fbb6ee
commit b8164cd3d2
2 changed files with 7 additions and 7 deletions
src/Fakes
tests/Unit/Api

View File

@ -106,7 +106,7 @@ class MemberFake extends Fake
return $this;
}
public function createsSuccessfully(int $groupId, int $memberId): self
public function stores(int $groupId, int $memberId): self
{
Http::fake(function ($request) use ($memberId, $groupId) {
$url = "https://nami.dpsg.de/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/{$groupId}";
@ -122,7 +122,7 @@ class MemberFake extends Fake
/**
* @param array<string, string|int|bool|null> $body
*/
public function assertCreated(int $groupId, array $body): void
public function assertStored(int $groupId, array $body): void
{
Http::assertSent(function ($request) use ($groupId, $body) {
$url = "https://nami.dpsg.de/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/{$groupId}";

View File

@ -10,7 +10,7 @@ class PutMemberTest extends TestCase
{
public function testPushASingleMember(): void
{
app(MemberFake::class)->createsSuccessfully(103, 16);
app(MemberFake::class)->stores(103, 16);
$member = Member::factory()->toMember([
'firstname' => 'Max',
'lastname' => 'Nach1',
@ -43,7 +43,7 @@ class PutMemberTest extends TestCase
$this->assertEquals(16, $response);
app(MemberFake::class)->assertCreated(103, [
app(MemberFake::class)->assertStored(103, [
'spitzname' => 'spitz1',
'vorname' => 'Max',
'nachname' => 'Nach1',