/** * @return void */ public function testCreate() { $this->beginDatabaseTransaction(); $body = $this->getCreateRequestBody(); /** @var Response $response */ $response = $this->callPost($this->admin(), $body); $this->assertEquals(Response::HTTP_CREATED, $response->getStatusCode()); $this->assertNotEmpty($resource = json_decode($response->getContent())->data); $this->assertNotNull($model = Model::findOrFail($resource->id)); $this->assertEquals('Post title', $model->{Model::FIELD_TITLE}); }