'config:rest.resource.dblog', 'http_response'
],
['user.permissions'
],
FALSE,
'MISS'
);
$log = Json::
decode((string) $response->
getBody());
$this->
assertEquals($id,
$log['wid'
], 'Log ID is correct.'
);
$this->
assertEquals('rest',
$log['type'
], 'Type of log message is correct.'
);
$this->
assertEquals('Test message',
$log['message'
], 'Log message text is correct.'
);
// Request an unknown log entry.
$url->
setRouteParameter('id', 9999
);
$response =
$this->
request('GET',
$url,
$request_options);
$this->
assertResourceErrorResponse(404, "Log entry with ID '9999' was not found",
$response);
// Make a bad request (a true malformed request would never be a route
// match).
$url->
setRouteParameter('id', 0
);
$response =
$this->
request('GET',
$url,
$request_options);
$this->
assertResourceErrorResponse(400, 'No log entry ID was provided',
$response);
} /**
* {@inheritdoc}
*/