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:
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user