Fixed membership fake
This commit is contained in:
parent
a4d8a2aefb
commit
b4f1972162
|
@ -284,7 +284,8 @@ class Api {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function member($groupId, $memberId) {
|
public function member(int $groupId, int $memberId): array
|
||||||
|
{
|
||||||
$this->assertLoggedIn();
|
$this->assertLoggedIn();
|
||||||
$url = $this->url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$groupId.'/'.$memberId;
|
$url = $this->url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$groupId.'/'.$memberId;
|
||||||
$response = $this->http()->get($url);
|
$response = $this->http()->get($url);
|
||||||
|
|
|
@ -17,4 +17,16 @@ class MemberFake extends Fake {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shows(int $groupId, int $memberId, array $data): void
|
||||||
|
{
|
||||||
|
Http::fake(function($request) use ($groupId, $memberId, $data) {
|
||||||
|
$url = 'https://nami.dpsg.de/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$groupId.'/'.$memberId;
|
||||||
|
if ($request->url() === $url && $request->method() === 'GET') {
|
||||||
|
return $this->dataResponse(array_merge([
|
||||||
|
|
||||||
|
], $data));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,9 +124,9 @@ class MembershipFake extends Fake {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
data_get($request, 'gruppierungId') !== data_get($payload, 'gruppierungId')
|
data_get($request, 'gruppierungId') !== data_get($payload, 'gruppierungId')
|
||||||
&& data_get($request, 'id') !== data_get($payload, 'id')
|
|| data_get($request, 'id') !== data_get($payload, 'id')
|
||||||
&& data_get($request, 'taetigkeitId') !== data_get($payload, 'taetigkeitId')
|
|| data_get($request, 'taetigkeitId') !== data_get($payload, 'taetigkeitId')
|
||||||
&& data_get($request, 'untergliederungId') !== data_get($payload, 'untergliederungId')
|
|| data_get($request, 'untergliederungId') !== data_get($payload, 'untergliederungId')
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue