From 90d8dd61bcb3e6fc641254b04ebaa66f0844e9bd Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Tue, 29 Nov 2022 17:19:00 +0100 Subject: [PATCH] --wip-- [skip ci] --- src/Data/Member.php | 4 ++++ tests/Factories/MemberRequestFactory.php | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Data/Member.php b/src/Data/Member.php index 22bbde9..66b0a68 100644 --- a/src/Data/Member.php +++ b/src/Data/Member.php @@ -10,6 +10,10 @@ class Member extends Data public function __construct( #[MapInputName('vorname')] public string $firstname, + #[MapInputName('nachname')] + public string $lastname, + #[MapInputName('spitzname')] + public string $nickname, ) { } } diff --git a/tests/Factories/MemberRequestFactory.php b/tests/Factories/MemberRequestFactory.php index 3b7b3b2..fd1f73a 100644 --- a/tests/Factories/MemberRequestFactory.php +++ b/tests/Factories/MemberRequestFactory.php @@ -17,8 +17,23 @@ class MemberRequestFactory extends RequestFactory ]; } + public function withEmptyNames(): self + { + return $this->state([ + 'vorname' => '', + 'nachname' => '', + 'nickname' => '', + ]); + } + public function toSingleHttp(): FulfilledPromise { - return Http::response($this->create(), 200); + return Http::response(json_encode([ + 'success' => true, + 'message' => null, + 'title' => null, + 'data' => $this->create(), + 'responseType' => null, + ]), 200); } }