Commit 51d3d8a9 authored by alexpott's avatar alexpott
Browse files

Issue #2805281 by Wim Leers, damiankloip: ?_format=hal_json error responses...

Issue #2805281 by Wim Leers, damiankloip: ?_format=hal_json error responses are application/json, yet should be application/hal+json
parent 0f613741
......@@ -26,7 +26,3 @@ services:
class: Drupal\hal\Encoder\JsonEncoder
tags:
- { name: encoder, priority: 10, format: hal_json }
exception.default_json:
class: Drupal\hal\EventSubscriber\ExceptionHalJsonSubscriber
tags:
- { name: event_subscriber }
<?php
namespace Drupal\hal\EventSubscriber;
use Drupal\Core\EventSubscriber\ExceptionJsonSubscriber;
/**
* Handle HAL JSON exceptions the same as JSON exceptions.
*/
class ExceptionHalJsonSubscriber extends ExceptionJsonSubscriber {
/**
* {@inheritdoc}
*/
protected function getHandledFormats() {
return ['hal_json'];
}
}
......@@ -27,9 +27,4 @@ class BlockHalJsonAnonTest extends BlockResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
}
......@@ -27,11 +27,6 @@ class BlockHalJsonBasicAuthTest extends BlockResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -27,11 +27,6 @@ class BlockHalJsonCookieTest extends BlockResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -27,11 +27,6 @@ abstract class CommentHalJsonTestBase extends CommentResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*
......
......@@ -27,9 +27,4 @@ class ConfigTestHalJsonAnonTest extends ConfigTestResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
}
......@@ -27,11 +27,6 @@ class ConfigTestHalJsonBasicAuthTest extends ConfigTestResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -27,11 +27,6 @@ class ConfigTestHalJsonCookieTest extends ConfigTestResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -31,11 +31,6 @@ class EntityTestHalJsonAnonTest extends EntityTestResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -31,11 +31,6 @@ class NodeHalJsonAnonTest extends NodeResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -27,9 +27,4 @@ class RoleHalJsonAnonTest extends RoleResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
}
......@@ -27,11 +27,6 @@ class RoleHalJsonBasicAuthTest extends RoleResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -27,11 +27,6 @@ class RoleHalJsonCookieTest extends RoleResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -30,11 +30,6 @@ class TermHalJsonAnonTest extends TermResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -30,11 +30,6 @@ class UserHalJsonAnonTest extends UserResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -27,11 +27,6 @@ class VocabularyHalJsonAnonTest extends VocabularyResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* @todo Remove this override in https://www.drupal.org/node/2805281.
*/
......
......@@ -27,11 +27,6 @@ class VocabularyHalJsonBasicAuthTest extends VocabularyResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -27,11 +27,6 @@ class VocabularyHalJsonCookieTest extends VocabularyResourceTestBase {
*/
protected static $mimeType = 'application/hal+json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
/**
* {@inheritdoc}
*/
......
......@@ -21,9 +21,4 @@ class BlockJsonAnonTest extends BlockResourceTestBase {
*/
protected static $mimeType = 'application/json';
/**
* {@inheritdoc}
*/
protected static $expectedErrorMimeType = 'application/json';
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment