1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

chore: drop the need for a json-api-server fork (#3986)

* chore: drop the need for a json-api-server fork
* chore: custom Serializer
* chore
* chore: adapt
* fix
* phpstan
This commit is contained in:
Sami Mazouz
2024-06-21 10:46:24 +01:00
committed by GitHub
parent d73cd0ecdd
commit 3dd2382ea0
60 changed files with 2637 additions and 208 deletions

View File

@@ -209,7 +209,7 @@ class CreateTest extends TestCase
*/
public function discussion_creation_limited_by_throttler()
{
$this->send(
$response = $this->send(
$this->request('POST', '/api/discussions', [
'authenticatedAs' => 2,
'json' => [
@@ -224,6 +224,8 @@ class CreateTest extends TestCase
])
);
$this->assertEquals(201, $response->getStatusCode());
$response = $this->send(
$this->request('POST', '/api/discussions', [
'authenticatedAs' => 2,

View File

@@ -104,7 +104,7 @@ class CreateTest extends TestCase
*/
public function limited_by_throttler()
{
$this->send(
$response = $this->send(
$this->request('POST', '/api/posts', [
'authenticatedAs' => 2,
'json' => [
@@ -121,6 +121,8 @@ class CreateTest extends TestCase
])
);
$this->assertEquals(201, $response->getStatusCode(), (string) $response->getBody());
$response = $this->send(
$this->request('POST', '/api/posts', [
'authenticatedAs' => 2,

View File

@@ -191,8 +191,9 @@ class ConditionalTest extends TestCase
])
);
$payload = json_decode($response->getBody()->getContents(), true);
$payload = json_decode($body = $response->getBody()->getContents(), true);
$this->assertArrayHasKey('data', $payload, $body);
$this->assertArrayNotHasKey('customConditionalAttribute', $payload['data']['attributes']);
}
@@ -234,8 +235,9 @@ class ConditionalTest extends TestCase
])
);
$payload = json_decode($response->getBody()->getContents(), true);
$payload = json_decode($body = $response->getBody()->getContents(), true);
$this->assertArrayHasKey('data', $payload, $body);
$this->assertArrayHasKey('customConditionalAttribute', $payload['data']['attributes']);
}