diff --git a/modules/jsonapi/jsonapi.module b/modules/jsonapi/jsonapi.module index 70648d2..df5bc5c 100644 --- a/modules/jsonapi/jsonapi.module +++ b/modules/jsonapi/jsonapi.module @@ -18,15 +18,9 @@ function jsonapi_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.jsonapi': $output = '

' . t('About') . '

'; - $youtube_url = Url::fromUri('https://www.youtube.com/playlist?list=PLZOQ_ZMpYrZsyO-3IstImK1okrpfAjuMZ', [ - 'external' => TRUE, - ]); - $youtube_link = Link::fromTextAndUrl(t('online documentation for the JSON API module'), $youtube_url); - $spec_url = Url::fromUri('http://jsonapi.org', ['external' => TRUE]); - $spec_link = Link::fromTextAndUrl(t('JSON API Specification'), $spec_url); - $output .= '

' . t('The JSON API module is a fully compliant implementation of the @spec. By following shared conventions, you can increase productivity, take advantage of generalized tooling, and focus on what matters: your application. Clients built around JSON API are able to take advantage of its features such as efficiently caching responses, sometimes eliminating network requests entirely. For more information, see the @online.', [ - '@spec' => $spec_link->toString(), - '@online' => $youtube_link->toString(), + $output .= '

' . t('The JSON API module is a fully compliant implementation of the JSON API Specification. By following shared conventions, you can increase productivity, take advantage of generalized tooling, and focus on what matters: your application. Clients built around JSON API are able to take advantage of its features such as efficiently caching responses, sometimes eliminating network requests entirely. For more information, see the online documentation for the JSON API module.', [ + ':spec' => 'http://jsonapi.org', + ':docs' => 'https://www.youtube.com/playlist?list=PLZOQ_ZMpYrZsyO-3IstImK1okrpfAjuMZ', ]) . '

'; $output .= '
'; $output .= '
' . t('General') . '
'; diff --git a/modules/jsonapi/jsonapi.services.yml b/modules/jsonapi/jsonapi.services.yml index 2804940..f42e648 100644 --- a/modules/jsonapi/jsonapi.services.yml +++ b/modules/jsonapi/jsonapi.services.yml @@ -1,4 +1,18 @@ services: + serializer.normalizer.htt_exception.jsonapi: + class: Drupal\jsonapi\Normalizer\HttpExceptionNormalizer + arguments: ['@current_user'] + tags: + - { name: normalizer, priority: 1 } + serializer.normalizer.unprocessable_entity_exception.jsonapi: + class: Drupal\jsonapi\Normalizer\UnprocessableHttpEntityExceptionNormalizer + arguments: ['@current_user'] + tags: + - { name: normalizer, priority: 2 } + serializer.normalizer.scalar.jsonapi: + class: Drupal\jsonapi\Normalizer\ScalarNormalizer + tags: + - { name: normalizer, priority: 5 } serializer.normalizer.entity_reference_item.jsonapi: class: Drupal\jsonapi\Normalizer\RelationshipItemNormalizer arguments: ['@jsonapi.resource_type.repository', '@serializer.normalizer.jsonapi_document_toplevel.jsonapi',] @@ -8,19 +22,10 @@ services: class: Drupal\jsonapi\Normalizer\FieldItemNormalizer tags: - { name: normalizer, priority: 21 } - serializer.normalizer.scalar.jsonapi: - class: Drupal\jsonapi\Normalizer\ScalarNormalizer - tags: - - { name: normalizer, priority: 5 } serializer.normalizer.field.jsonapi: class: Drupal\jsonapi\Normalizer\FieldNormalizer tags: - { name: normalizer, priority: 21 } - serializer.normalizer.entity_reference_field.jsonapi: - class: Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer - arguments: ['@jsonapi.link_manager', '@entity_field.manager', '@plugin.manager.field.field_type', '@jsonapi.resource_type.repository', '@entity.repository'] - tags: - - { name: normalizer, priority: 31 } serializer.normalizer.relationship.jsonapi: class: Drupal\jsonapi\Normalizer\RelationshipNormalizer arguments: ['@jsonapi.resource_type.repository', '@jsonapi.link_manager'] @@ -41,16 +46,11 @@ services: arguments: ['@jsonapi.link_manager', '@jsonapi.current_context', '@entity_type.manager'] tags: - { name: normalizer, priority: 22 } - serializer.normalizer.htt_exception.jsonapi: - class: Drupal\jsonapi\Normalizer\HttpExceptionNormalizer - arguments: ['@current_user'] - tags: - - { name: normalizer, priority: 1 } - serializer.normalizer.unprocessable_entity_exception.jsonapi: - class: Drupal\jsonapi\Normalizer\UnprocessableHttpEntityExceptionNormalizer - arguments: ['@current_user'] + serializer.normalizer.entity_reference_field.jsonapi: + class: Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer + arguments: ['@jsonapi.link_manager', '@entity_field.manager', '@plugin.manager.field.field_type', '@jsonapi.resource_type.repository', '@entity.repository'] tags: - - { name: normalizer, priority: 2 } + - { name: normalizer, priority: 31 } serializer.encoder.jsonapi: class: Drupal\jsonapi\Encoder\JsonEncoder tags: diff --git a/modules/jsonapi/src/Access/CustomParameterNames.php b/modules/jsonapi/src/Access/CustomParameterNames.php index 7a89c56..a8ec382 100644 --- a/modules/jsonapi/src/Access/CustomParameterNames.php +++ b/modules/jsonapi/src/Access/CustomParameterNames.php @@ -33,6 +33,8 @@ class CustomParameterNames implements AccessInterface { /** * Validates the JSONAPI parameters. * + * @see http://jsonapi.org/format/#document-member-names-reserved-characters + * * @param string[] $json_api_params * The JSONAPI parameters. * @@ -42,7 +44,7 @@ class CustomParameterNames implements AccessInterface { $valid = TRUE; foreach (array_keys($json_api_params) as $name) { - if (strpbrk($name, '+,.[]!”#$%&’()*/:;<=>?@^`{}~|')) { + if (strpbrk($name, "+,.[]!”#$%&’()*/:;<=>?@\\^`{}~|\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9\xA\xB\xC\xD\xE\xF\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F")) { $valid = FALSE; break; } diff --git a/modules/jsonapi/src/Context/CurrentContext.php b/modules/jsonapi/src/Context/CurrentContext.php index bc3370d..bcd42a1 100644 --- a/modules/jsonapi/src/Context/CurrentContext.php +++ b/modules/jsonapi/src/Context/CurrentContext.php @@ -97,12 +97,11 @@ class CurrentContext { * The JSON API provided parameter. */ public function getJsonApiParameter($parameter_key) { - $params = $this + return $this ->requestStack ->getCurrentRequest() ->attributes - ->get('_json_api_params'); - return (isset($params[$parameter_key])) ? $params[$parameter_key] : NULL; + ->get("_json_api_params[$parameter_key]", NULL, TRUE); } /** diff --git a/modules/jsonapi/src/Context/FieldResolver.php b/modules/jsonapi/src/Context/FieldResolver.php index b2adcd3..9eab90d 100644 --- a/modules/jsonapi/src/Context/FieldResolver.php +++ b/modules/jsonapi/src/Context/FieldResolver.php @@ -3,7 +3,7 @@ namespace Drupal\jsonapi\Context; use Drupal\Core\Entity\EntityFieldManagerInterface; -use Drupal\jsonapi\Error\SerializableHttpException; +use Drupal\jsonapi\Exception\SerializableHttpException; /** * Service which resolves public field names to and from Drupal field names. diff --git a/modules/jsonapi/src/Controller/EntityResource.php b/modules/jsonapi/src/Controller/EntityResource.php index eab187e..907171b 100644 --- a/modules/jsonapi/src/Controller/EntityResource.php +++ b/modules/jsonapi/src/Controller/EntityResource.php @@ -18,8 +18,8 @@ use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; use Drupal\jsonapi\Resource\EntityCollection; use Drupal\jsonapi\Resource\JsonApiDocumentTopLevel; use Drupal\jsonapi\ResourceType\ResourceType; -use Drupal\jsonapi\Error\SerializableHttpException; -use Drupal\jsonapi\Error\UnprocessableHttpEntityException; +use Drupal\jsonapi\Exception\SerializableHttpException; +use Drupal\jsonapi\Exception\UnprocessableHttpEntityException; use Drupal\jsonapi\Query\QueryBuilder; use Drupal\jsonapi\Context\CurrentContext; use Drupal\jsonapi\ResourceResponse; @@ -129,7 +129,7 @@ class EntityResource { * @param \Drupal\Core\Entity\EntityInterface $entity * The entity object. * - * @throws \Drupal\jsonapi\Error\SerializableHttpException + * @throws \Drupal\jsonapi\Exception\SerializableHttpException * If validation errors are found. */ protected function validate(EntityInterface $entity) { @@ -248,8 +248,8 @@ class EntityResource { // Instantiate the query for the filtering. $entity_type_id = $this->resourceType->getEntityTypeId(); - $params = $request->attributes->get('_route_params'); - $query = $this->getCollectionQuery($entity_type_id, $params['_json_api_params']); + $params = $request->attributes->get('_route_params[_json_api_params]', NULL, TRUE); + $query = $this->getCollectionQuery($entity_type_id, $params); $results = $query->execute(); @@ -644,8 +644,11 @@ class EntityResource { // The update is different for configuration entities and content entities. if ($origin instanceof ContentEntityInterface && $destination instanceof ContentEntityInterface) { // First scenario: both are content entities. - if (!$destination_field_list = $destination->get($field_name)) { - throw new SerializableHttpException(400, sprintf('The provided field (%s) does not exist in the entity with ID %d.', $field_name, $destination->id())); + try { + $destination_field_list = $destination->get($field_name); + } + catch (\Exception $e) { + throw new SerializableHttpException(400, sprintf('The provided field (%s) does not exist in the entity with ID %s.', $field_name, $destination->uuid())); } $origin_field_list = $origin->get($field_name); @@ -675,9 +678,7 @@ class EntityResource { * Returns TRUE, if entity field is EntityReferenceItem. */ protected function isRelationshipField($entity_field) { - /** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */ - $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); - $class = $field_type_manager->getPluginClass($entity_field->getDataDefinition()->getType()); + $class = $this->pluginManager->getPluginClass($entity_field->getDataDefinition()->getType()); return ($class == EntityReferenceItem::class || is_subclass_of($class, EntityReferenceItem::class)); } diff --git a/modules/jsonapi/src/Controller/RequestHandler.php b/modules/jsonapi/src/Controller/RequestHandler.php index c4616b0..c318b5a 100644 --- a/modules/jsonapi/src/Controller/RequestHandler.php +++ b/modules/jsonapi/src/Controller/RequestHandler.php @@ -7,7 +7,7 @@ use Drupal\Core\Render\RenderContext; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\jsonapi\Context\CurrentContext; use Drupal\jsonapi\Error\ErrorHandler; -use Drupal\jsonapi\Error\SerializableHttpException; +use Drupal\jsonapi\Exception\SerializableHttpException; use Drupal\jsonapi\ResourceResponse; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; diff --git a/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php b/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php index 55c1a8d..fb21a3e 100644 --- a/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php +++ b/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php @@ -2,7 +2,7 @@ namespace Drupal\jsonapi\EventSubscriber; -use Drupal\jsonapi\Error\SerializableHttpException; +use Drupal\jsonapi\Exception\SerializableHttpException; use Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber as SerializationDefaultExceptionSubscriber; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; diff --git a/modules/jsonapi/src/Error/SerializableHttpException.php b/modules/jsonapi/src/Exception/SerializableHttpException.php similarity index 87% rename from modules/jsonapi/src/Error/SerializableHttpException.php rename to modules/jsonapi/src/Exception/SerializableHttpException.php index 91b0732..3aaa117 100644 --- a/modules/jsonapi/src/Error/SerializableHttpException.php +++ b/modules/jsonapi/src/Exception/SerializableHttpException.php @@ -1,6 +1,6 @@ formats) && parent::supportsNormalization($data, $format); + return in_array($format, $this->formats, TRUE) && parent::supportsNormalization($data, $format); } /** * {@inheritdoc} */ public function supportsDenormalization($data, $type, $format = NULL) { - if (in_array($format, $this->formats) && (class_exists($this->supportedInterfaceOrClass) || interface_exists($this->supportedInterfaceOrClass))) { + if (in_array($format, $this->formats, TRUE) && (class_exists($this->supportedInterfaceOrClass) || interface_exists($this->supportedInterfaceOrClass))) { $target = new \ReflectionClass($type); $supported = new \ReflectionClass($this->supportedInterfaceOrClass); if ($supported->isInterface()) { diff --git a/modules/jsonapi/src/Normalizer/UnprocessableHttpEntityExceptionNormalizer.php b/modules/jsonapi/src/Normalizer/UnprocessableHttpEntityExceptionNormalizer.php index 556defa..2326d81 100644 --- a/modules/jsonapi/src/Normalizer/UnprocessableHttpEntityExceptionNormalizer.php +++ b/modules/jsonapi/src/Normalizer/UnprocessableHttpEntityExceptionNormalizer.php @@ -3,7 +3,7 @@ namespace Drupal\jsonapi\Normalizer; use Drupal\Core\Session\AccountProxyInterface; -use Drupal\jsonapi\Error\UnprocessableHttpEntityException; +use Drupal\jsonapi\Exception\UnprocessableHttpEntityException; use Symfony\Component\HttpKernel\Exception\HttpException; /** @@ -37,7 +37,7 @@ class UnprocessableHttpEntityExceptionNormalizer extends HttpExceptionNormalizer * {@inheritdoc} */ protected function buildErrorObjects(HttpException $exception) { - /** @var $exception \Drupal\jsonapi\Error\UnprocessableHttpEntityException */ + /** @var $exception \Drupal\jsonapi\Exception\UnprocessableHttpEntityException */ $errors = parent::buildErrorObjects($exception); $error = $errors[0]; unset($error['links']); diff --git a/modules/jsonapi/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php b/modules/jsonapi/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php index ce9f46c..628c9d8 100644 --- a/modules/jsonapi/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php +++ b/modules/jsonapi/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php @@ -72,9 +72,7 @@ class JsonApiDocumentTopLevelNormalizerValue implements ValueExtractorInterface, */ public function __construct(array $values, array $context, $is_collection = FALSE, array $link_context) { $this->values = $values; - array_walk($values, function ($value) { - $this->addCacheableDependency($value); - }); + array_walk($values, [$this, 'addCacheableDependency']); // Make sure that different sparse fieldsets are cached differently. $this->addCacheableDependency(new RequestCacheabilityDependency()); @@ -90,9 +88,7 @@ class JsonApiDocumentTopLevelNormalizerValue implements ValueExtractorInterface, }, $values); // Flatten the includes. $this->includes = array_reduce($this->includes, function ($carry, $includes) { - array_walk($includes, function ($include) { - $this->addCacheableDependency($include); - }); + array_walk($includes, [$this, 'addCacheableDependency']); return array_merge($carry, $includes); }, []); // Filter the empty values. diff --git a/modules/jsonapi/src/Query/GroupOption.php b/modules/jsonapi/src/Query/GroupOption.php index 050ba63..d51a20c 100644 --- a/modules/jsonapi/src/Query/GroupOption.php +++ b/modules/jsonapi/src/Query/GroupOption.php @@ -146,11 +146,7 @@ class GroupOption implements QueryOptionInterface, QueryOptionTreeItemInterface // If any child GroupOptions or their children have the id return TRUE. return array_reduce($this->groupOptions, function ($has_child, $group) use ($id) { // If we already know that we have the child, skip evaluation and return. - if (!$has_child) { - // Determine if this group or any of its children match the $id. - $has_child = ($group->id() == $id || $group->hasChild($id)); - } - return $has_child; + return $has_child || $group->id() == $id || $group->hasChild($id); }, FALSE); } diff --git a/modules/jsonapi/src/Query/QueryBuilder.php b/modules/jsonapi/src/Query/QueryBuilder.php index f439aa5..0e84c03 100644 --- a/modules/jsonapi/src/Query/QueryBuilder.php +++ b/modules/jsonapi/src/Query/QueryBuilder.php @@ -4,7 +4,7 @@ namespace Drupal\jsonapi\Query; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\jsonapi\Error\SerializableHttpException; +use Drupal\jsonapi\Exception\SerializableHttpException; use Drupal\jsonapi\Routing\Param\OffsetPage; use Drupal\jsonapi\Routing\Param\Filter; use Drupal\jsonapi\Routing\Param\JsonApiParamInterface; diff --git a/modules/jsonapi/src/Resource/EntityCollection.php b/modules/jsonapi/src/Resource/EntityCollection.php index beb1f08..d173abc 100644 --- a/modules/jsonapi/src/Resource/EntityCollection.php +++ b/modules/jsonapi/src/Resource/EntityCollection.php @@ -12,7 +12,7 @@ class EntityCollection implements \IteratorAggregate, \Countable { /** * Entity storage. * - * @var array + * @var \Drupal\Core\Entity\EntityInterface[] */ protected $entities; @@ -26,7 +26,7 @@ class EntityCollection implements \IteratorAggregate, \Countable { /** * Instantiates a EntityCollection object. * - * @param array $entities + * @param \Drupal\Core\Entity\EntityInterface[] $entities * The entities for the collection. */ public function __construct(array $entities) { diff --git a/modules/jsonapi/src/Routing/Param/Filter.php b/modules/jsonapi/src/Routing/Param/Filter.php index 3869db3..2033473 100644 --- a/modules/jsonapi/src/Routing/Param/Filter.php +++ b/modules/jsonapi/src/Routing/Param/Filter.php @@ -1,7 +1,7 @@ assertEquals("body.0.format: The value you selected is not a valid choice.", $updated_response['errors'][1]['detail']); $this->assertEquals("/data/attributes/title", $updated_response['errors'][0]['source']['pointer']); $this->assertEquals("/data/attributes/body/format", $updated_response['errors'][1]['source']['pointer']); - // 13. Successful DELETE. + // 13. PATCH with field that doesn't exist on Entity. + $body = [ + 'data' => [ + 'id' => $uuid, + 'type' => 'node--article', + 'attributes' => [ + 'field_that_doesnt_exist' => 'foobar', + ], + ], + ]; + $response = $this->request('PATCH', $individual_url, [ + 'body' => Json::encode($body), + 'auth' => [$this->user->getUsername(), $this->user->pass_raw], + 'headers' => ['Content-Type' => 'application/vnd.api+json'], + ]); + $updated_response = Json::decode($response->getBody()->__toString()); + $this->assertEquals(400, $response->getStatusCode()); + $this->assertEquals("The provided field (field_that_doesnt_exist) does not exist in the entity with ID $uuid.", + $updated_response['errors']['0']['detail']); + // 14. Successful DELETE. $response = $this->request('DELETE', $individual_url, [ 'auth' => [$this->user->getUsername(), $this->user->pass_raw], ]); diff --git a/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php b/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php index aff2c58..93e8609 100644 --- a/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php +++ b/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php @@ -166,7 +166,7 @@ class EntityResourceTest extends JsonapiKernelTestBase { /** * @covers ::getIndividual - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testGetIndividualDenied() { $role = Role::load(RoleInterface::ANONYMOUS_ID); diff --git a/modules/jsonapi/tests/src/Unit/Access/CustomParameterNamesTest.php b/modules/jsonapi/tests/src/Unit/Access/CustomParameterNamesTest.php index 632b402..7ba1845 100644 --- a/modules/jsonapi/tests/src/Unit/Access/CustomParameterNamesTest.php +++ b/modules/jsonapi/tests/src/Unit/Access/CustomParameterNamesTest.php @@ -72,7 +72,7 @@ class CustomParameterNamesTest extends \PHPUnit_Framework_TestCase { '>', '?', '@', - '“', + '\\', '^', '`', '{', @@ -84,6 +84,10 @@ class CustomParameterNamesTest extends \PHPUnit_Framework_TestCase { $data['unsafe-' . $unsafe_char] = ['kitt' . $unsafe_char . 'ens', FALSE]; } + for ($ascii = 0; $ascii <= 0x1F; $ascii++) { + $data['unsafe-' . $ascii] = ['kitt' . chr($ascii) . 'ens', FALSE]; + } + return $data; } diff --git a/modules/jsonapi/tests/src/Unit/Context/FieldResolverTest.php b/modules/jsonapi/tests/src/Unit/Context/FieldResolverTest.php index 12fa6b0..0fe7e6c 100644 --- a/modules/jsonapi/tests/src/Unit/Context/FieldResolverTest.php +++ b/modules/jsonapi/tests/src/Unit/Context/FieldResolverTest.php @@ -97,7 +97,7 @@ class FieldResolverTest extends UnitTestCase { * * @covers ::resolveInternal * - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testResolveInternalError() { $field_manager = $this->prophesize(EntityFieldManagerInterface::class); diff --git a/modules/jsonapi/tests/src/Unit/LinkManager/LinkManagerTest.php b/modules/jsonapi/tests/src/Unit/LinkManager/LinkManagerTest.php index 65ccefe..996e59c 100644 --- a/modules/jsonapi/tests/src/Unit/LinkManager/LinkManagerTest.php +++ b/modules/jsonapi/tests/src/Unit/LinkManager/LinkManagerTest.php @@ -120,7 +120,7 @@ class LinkManagerTest extends UnitTestCase { * Test errors. * * @covers ::getPagerLinks - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException * @dataProvider getPagerLinksErrorProvider */ public function testGetPagerLinksError($offset, $size, $total, array $pages) { diff --git a/modules/jsonapi/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php b/modules/jsonapi/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php index 144ffc6..2f27c5d 100644 --- a/modules/jsonapi/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php +++ b/modules/jsonapi/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php @@ -130,7 +130,7 @@ class EntityReferenceFieldNormalizerTest extends UnitTestCase { /** * @covers ::denormalize - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException * @dataProvider denormalizeInvalidResourceProvider */ public function testDenormalizeInvalidResource($data, $field_name) { diff --git a/modules/jsonapi/tests/src/Unit/Routing/Param/FilterTest.php b/modules/jsonapi/tests/src/Unit/Routing/Param/FilterTest.php index ebddb20..15b1928 100644 --- a/modules/jsonapi/tests/src/Unit/Routing/Param/FilterTest.php +++ b/modules/jsonapi/tests/src/Unit/Routing/Param/FilterTest.php @@ -87,7 +87,7 @@ class FilterTest extends UnitTestCase { /** * @covers ::get - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testGetFail() { $pager = new Filter( diff --git a/modules/jsonapi/tests/src/Unit/Routing/Param/OffsetPageTest.php b/modules/jsonapi/tests/src/Unit/Routing/Param/OffsetPageTest.php index a5fb407..c23e5e0 100644 --- a/modules/jsonapi/tests/src/Unit/Routing/Param/OffsetPageTest.php +++ b/modules/jsonapi/tests/src/Unit/Routing/Param/OffsetPageTest.php @@ -35,7 +35,7 @@ class OffsetPageTest extends UnitTestCase { /** * @covers ::get - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testGetFail() { $pager = new OffsetPage('lorem'); diff --git a/modules/jsonapi/tests/src/Unit/Routing/Param/SortTest.php b/modules/jsonapi/tests/src/Unit/Routing/Param/SortTest.php index 5774029..a407ea5 100644 --- a/modules/jsonapi/tests/src/Unit/Routing/Param/SortTest.php +++ b/modules/jsonapi/tests/src/Unit/Routing/Param/SortTest.php @@ -52,7 +52,7 @@ class SortTest extends UnitTestCase { /** * @covers ::get * @dataProvider getFailProvider - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testGetFail($input) { $sort = new Sort($input);