src/Normalizer/FieldNormalizer.php | 1 - .../src/Plugin/DataType/CacheableStringData.php | 2 +- tests/src/Kernel/Serializer/ComputedFieldSerializerTest.php | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Normalizer/FieldNormalizer.php b/src/Normalizer/FieldNormalizer.php index 76bd532..4d57dd6 100644 --- a/src/Normalizer/FieldNormalizer.php +++ b/src/Normalizer/FieldNormalizer.php @@ -3,7 +3,6 @@ namespace Drupal\jsonapi\Normalizer; use Drupal\Component\Assertion\Inspector; -use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Field\EntityReferenceFieldItemList; use Drupal\Core\Field\FieldDefinitionInterface; diff --git a/tests/modules/jsonapi_test_computed_field/src/Plugin/DataType/CacheableStringData.php b/tests/modules/jsonapi_test_computed_field/src/Plugin/DataType/CacheableStringData.php index 4cce0a8..df8f7ea 100644 --- a/tests/modules/jsonapi_test_computed_field/src/Plugin/DataType/CacheableStringData.php +++ b/tests/modules/jsonapi_test_computed_field/src/Plugin/DataType/CacheableStringData.php @@ -17,7 +17,7 @@ use Drupal\Core\TypedData\Plugin\DataType\StringData; * label = @Translation("Cacheable String") * ) */ -class CacheableStringData extends StringData implements CacheableDependencyInterface { +class CacheableStringData extends StringData implements CacheableDependencyInterface { use CacheableDependencyTrait; diff --git a/tests/src/Kernel/Serializer/ComputedFieldSerializerTest.php b/tests/src/Kernel/Serializer/ComputedFieldSerializerTest.php index 161cc00..1eaaf06 100644 --- a/tests/src/Kernel/Serializer/ComputedFieldSerializerTest.php +++ b/tests/src/Kernel/Serializer/ComputedFieldSerializerTest.php @@ -28,7 +28,7 @@ class ComputedFieldSerializerTest extends JsonapiKernelTestBase { * * @var \Drupal\entity_test\Entity\EntityTest */ - protected $entity_test; + protected $entity; /** * The subject under test. @@ -48,18 +48,18 @@ class ComputedFieldSerializerTest extends JsonapiKernelTestBase { $this->installSchema('system', ['sequences']); $this->container->setAlias('sut', 'jsonapi.serializer_do_not_use_removal_imminent'); $this->sut = $this->container->get('sut'); - $this->entity_test = EntityTest::create([ + $this->entity = EntityTest::create([ 'name' => 'Test Entity for Computed Field', 'type' => 'entity_test', ]); - $this->entity_test->save(); + $this->entity->save(); } /** * @covers \Drupal\jsonapi\Serializer\Serializer::normalize */ public function testFallbackNormalizer() { - $value = $this->sut->normalize($this->entity_test, 'api_json'); + $value = $this->sut->normalize($this->entity, 'api_json'); $this->assertInstanceOf(EntityNormalizerValue::class, $value); $this->assertContains('user', $value->getCacheContexts()); $this->assertContains('field:jsonapi_test_computed_field', $value->getCacheTags());