tests/src/Functional/BlockContentTest.php | 12 ------------ tests/src/Functional/CommentTest.php | 12 ------------ tests/src/Functional/EntityTestTest.php | 3 --- tests/src/Functional/FeedTest.php | 2 -- tests/src/Functional/FileTest.php | 2 -- tests/src/Functional/JsonApiFunctionalTest.php | 6 +++--- tests/src/Functional/MediaTest.php | 12 ------------ tests/src/Functional/MenuLinkContentTest.php | 3 --- tests/src/Functional/ShortcutTest.php | 14 -------------- tests/src/Functional/TermTest.php | 12 ------------ tests/src/Functional/UserTest.php | 2 -- .../Normalizer/JsonApiDocumentTopLevelNormalizerTest.php | 15 ++------------- 12 files changed, 5 insertions(+), 90 deletions(-) diff --git a/tests/src/Functional/BlockContentTest.php b/tests/src/Functional/BlockContentTest.php index e814b3b..b914d7e 100644 --- a/tests/src/Functional/BlockContentTest.php +++ b/tests/src/Functional/BlockContentTest.php @@ -113,7 +113,6 @@ class BlockContentTest extends ResourceTestBase { 'self' => $self_url, ], 'attributes' => [ - 'id' => 1, 'body' => [ 'value' => 'The name "llama" was adopted by European settlers from native Peruvians.', 'format' => 'plain_text', @@ -129,19 +128,8 @@ class BlockContentTest extends ResourceTestBase { 'status' => FALSE, 'langcode' => 'en', 'default_langcode' => TRUE, - 'uuid' => $this->entity->uuid(), ], 'relationships' => [ - 'type' => [ - 'data' => [ - 'id' => BlockContentType::load('basic')->uuid(), - 'type' => 'block_content_type--block_content_type', - ], - 'links' => [ - 'related' => $self_url . '/type', - 'self' => $self_url . '/relationships/type', - ], - ], 'revision_user' => [ 'data' => NULL, 'links' => [ diff --git a/tests/src/Functional/CommentTest.php b/tests/src/Functional/CommentTest.php index 0ef8e07..59711d4 100644 --- a/tests/src/Functional/CommentTest.php +++ b/tests/src/Functional/CommentTest.php @@ -150,7 +150,6 @@ class CommentTest extends ResourceTestBase { 'self' => $self_url, ], 'attributes' => [ - 'cid' => 1, 'created' => '1973-11-29T21:33:09+00:00', 'changed' => (new \DateTime())->setTimestamp($this->entity->getChangedTime())->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), 'comment_body' => [ @@ -167,7 +166,6 @@ class CommentTest extends ResourceTestBase { 'status' => TRUE, 'subject' => 'Llama', 'thread' => '01/', - 'uuid' => $this->entity->uuid(), ], 'relationships' => [ 'uid' => [ @@ -180,16 +178,6 @@ class CommentTest extends ResourceTestBase { 'self' => $self_url . '/relationships/uid', ], ], - 'comment_type' => [ - 'data' => [ - 'id' => CommentType::load('comment')->uuid(), - 'type' => 'comment_type--comment_type', - ], - 'links' => [ - 'related' => $self_url . '/comment_type', - 'self' => $self_url . '/relationships/comment_type', - ], - ], 'entity_id' => [ 'data' => [ 'id' => EntityTest::load(1)->uuid(), diff --git a/tests/src/Functional/EntityTestTest.php b/tests/src/Functional/EntityTestTest.php index ebc3312..604a2fa 100644 --- a/tests/src/Functional/EntityTestTest.php +++ b/tests/src/Functional/EntityTestTest.php @@ -113,13 +113,10 @@ class EntityTestTest extends ResourceTestBase { 'self' => $self_url, ], 'attributes' => [ - 'id' => 1, 'created' => (new \DateTime())->setTimestamp($this->entity->get('created')->value)->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), 'field_test_text' => NULL, 'langcode' => 'en', 'name' => 'Llama', - 'type' => 'entity_test', - 'uuid' => $this->entity->uuid(), ], 'relationships' => [ 'user_id' => [ diff --git a/tests/src/Functional/FeedTest.php b/tests/src/Functional/FeedTest.php index febf61c..f4cc0ed 100644 --- a/tests/src/Functional/FeedTest.php +++ b/tests/src/Functional/FeedTest.php @@ -119,8 +119,6 @@ class FeedTest extends ResourceTestBase { 'self' => $self_url, ], 'attributes' => [ - 'uuid' => $this->entity->uuid(), - 'fid' => 1, 'url' => 'http://example.com/rss.xml', 'title' => 'Feed', 'refresh' => 900, diff --git a/tests/src/Functional/FileTest.php b/tests/src/Functional/FileTest.php index 1451d9b..406be40 100644 --- a/tests/src/Functional/FileTest.php +++ b/tests/src/Functional/FileTest.php @@ -142,7 +142,6 @@ class FileTest extends ResourceTestBase { 'attributes' => [ 'created' => (new \DateTime())->setTimestamp($this->entity->getCreatedTime())->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), 'changed' => (new \DateTime())->setTimestamp($this->entity->getChangedTime())->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), - 'fid' => 1, 'filemime' => 'text/plain', 'filename' => 'drupal.txt', 'filesize' => (int) $this->entity->getSize(), @@ -152,7 +151,6 @@ class FileTest extends ResourceTestBase { 'url' => base_path() . $this->siteDirectory . '/files/drupal.txt', 'value' => 'public://drupal.txt', ], - 'uuid' => $this->entity->uuid(), ], 'relationships' => [ 'uid' => [ diff --git a/tests/src/Functional/JsonApiFunctionalTest.php b/tests/src/Functional/JsonApiFunctionalTest.php index 9d7af18..3dcf08d 100644 --- a/tests/src/Functional/JsonApiFunctionalTest.php +++ b/tests/src/Functional/JsonApiFunctionalTest.php @@ -101,7 +101,7 @@ class JsonApiFunctionalTest extends JsonApiFunctionalTestBase { ])); $this->assertSession()->statusCodeEquals(200); $this->assertEquals('taxonomy_term--tags', $single_output['data'][0]['type']); - $this->assertArrayHasKey('tid', $single_output['data'][0]['attributes']); + $this->assertArrayNotHasKey('tid', $single_output['data'][0]['attributes']); $this->assertContains( '/taxonomy_term/tags/', $single_output['data'][0]['links']['self'] @@ -527,8 +527,8 @@ class JsonApiFunctionalTest extends JsonApiFunctionalTestBase { ]); $created_response = Json::decode($response->getBody()->__toString()); $this->assertEquals(201, $response->getStatusCode()); - $this->assertArrayHasKey('uuid', $created_response['data']['attributes']); - $uuid = $created_response['data']['attributes']['uuid']; + $this->assertArrayNotHasKey('uuid', $created_response['data']['attributes']); + $uuid = $created_response['data']['id']; $this->assertEquals(2, count($created_response['data']['relationships']['field_tags']['data'])); $this->assertEquals($created_response['data']['links']['self'], $response->getHeader('Location')[0]); diff --git a/tests/src/Functional/MediaTest.php b/tests/src/Functional/MediaTest.php index 4f78ac0..2154245 100644 --- a/tests/src/Functional/MediaTest.php +++ b/tests/src/Functional/MediaTest.php @@ -167,7 +167,6 @@ class MediaTest extends ResourceTestBase { 'self' => $self_url, ], 'attributes' => [ - 'mid' => 1, 'vid' => 1, 'langcode' => 'en', 'name' => 'Llama', @@ -179,7 +178,6 @@ class MediaTest extends ResourceTestBase { 'revision_log_message' => NULL, // @todo Attempt to remove this in https://www.drupal.org/project/drupal/issues/2933518. 'revision_translation_affected' => TRUE, - 'uuid' => $this->entity->uuid(), ], 'relationships' => [ 'field_media_file' => [ @@ -212,16 +210,6 @@ class MediaTest extends ResourceTestBase { 'self' => $self_url . '/relationships/thumbnail', ], ], - 'bundle' => [ - 'data' => [ - 'id' => MediaType::load('camelids')->uuid(), - 'type' => 'media_type--media_type', - ], - 'links' => [ - 'related' => $self_url . '/bundle', - 'self' => $self_url . '/relationships/bundle', - ], - ], 'uid' => [ 'data' => [ 'id' => $author->uuid(), diff --git a/tests/src/Functional/MenuLinkContentTest.php b/tests/src/Functional/MenuLinkContentTest.php index 2bd350e..e4df085 100644 --- a/tests/src/Functional/MenuLinkContentTest.php +++ b/tests/src/Functional/MenuLinkContentTest.php @@ -89,8 +89,6 @@ class MenuLinkContentTest extends ResourceTestBase { 'self' => $self_url, ], 'attributes' => [ - 'bundle' => 'menu_link_content', - 'id' => 1, 'link' => [ 'uri' => 'https://nl.wikipedia.org/wiki/Llama', 'title' => NULL, @@ -107,7 +105,6 @@ class MenuLinkContentTest extends ResourceTestBase { 'parent' => NULL, 'rediscover' => FALSE, 'title' => 'Llama Gabilondo', - 'uuid' => $this->entity->uuid(), 'weight' => 0, ], ], diff --git a/tests/src/Functional/ShortcutTest.php b/tests/src/Functional/ShortcutTest.php index a2514c4..b72e28e 100644 --- a/tests/src/Functional/ShortcutTest.php +++ b/tests/src/Functional/ShortcutTest.php @@ -88,8 +88,6 @@ class ShortcutTest extends ResourceTestBase { 'self' => $self_url, ], 'attributes' => [ - 'uuid' => $this->entity->uuid(), - 'id' => (int) $this->entity->id(), 'title' => 'Comments', 'link' => [ 'uri' => 'internal:/user/logout', @@ -100,18 +98,6 @@ class ShortcutTest extends ResourceTestBase { 'default_langcode' => TRUE, 'weight' => -20, ], - 'relationships' => [ - 'shortcut_set' => [ - 'data' => [ - 'type' => 'shortcut_set--shortcut_set', - 'id' => ShortcutSet::load('default')->uuid(), - ], - 'links' => [ - 'related' => $self_url . '/shortcut_set', - 'self' => $self_url . '/relationships/shortcut_set', - ], - ], - ], ], ]; } diff --git a/tests/src/Functional/TermTest.php b/tests/src/Functional/TermTest.php index ac846d4..a62ad76 100644 --- a/tests/src/Functional/TermTest.php +++ b/tests/src/Functional/TermTest.php @@ -255,22 +255,10 @@ class TermTest extends ResourceTestBase { 'pid' => 1, 'langcode' => 'en', ], - 'tid' => 1, - 'uuid' => $this->entity->uuid(), 'weight' => 0, ], 'relationships' => [ 'parent' => $expected_parent_normalization, - 'vid' => [ - 'data' => [ - 'id' => Vocabulary::load('camelids')->uuid(), - 'type' => 'taxonomy_vocabulary--taxonomy_vocabulary', - ], - 'links' => [ - 'related' => $self_url . '/vid', - 'self' => $self_url . '/relationships/vid', - ], - ], ], ], ]; diff --git a/tests/src/Functional/UserTest.php b/tests/src/Functional/UserTest.php index a4d2417..6795331 100644 --- a/tests/src/Functional/UserTest.php +++ b/tests/src/Functional/UserTest.php @@ -140,8 +140,6 @@ class UserTest extends ResourceTestBase { 'default_langcode' => TRUE, 'langcode' => 'en', 'name' => 'Llama', - 'uid' => 3, - 'uuid' => $this->entity->uuid(), ], ], ]; diff --git a/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php b/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php index dadc575..a1a7f63 100644 --- a/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php +++ b/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php @@ -232,16 +232,6 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase { $this->assertSame($normalized['data']['attributes']['title'], 'dummy_title'); $this->assertEquals($normalized['data']['id'], $this->node->uuid()); - $this->assertSame([ - 'data' => [ - 'type' => 'node_type--node_type', - 'id' => NodeType::load('article')->uuid(), - ], - 'links' => [ - 'self' => 'dummy_entity_link', - 'related' => 'dummy_entity_link', - ], - ], $normalized['data']['relationships']['type']); $this->assertTrue(!isset($normalized['data']['attributes']['created'])); $this->assertEquals([ 'alt' => 'test alt', @@ -268,7 +258,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase { $this->assertSame($this->term1->uuid(), $normalized['included'][1]['id']); $this->assertSame('taxonomy_term--tags', $normalized['included'][1]['type']); $this->assertSame($this->term1->label(), $normalized['included'][1]['attributes']['name']); - $this->assertCount(8, $normalized['included'][1]['attributes']); + $this->assertCount(6, $normalized['included'][1]['attributes']); $this->assertTrue(!isset($normalized['included'][1]['attributes']['created'])); // Make sure that the cache tags for the includes and the requested entities // are bubbling as expected. @@ -359,13 +349,12 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase { ); $normalized = $jsonapi_doc_object->rasterizeValue(); $this->assertStringMatchesFormat($this->node->uuid(), $normalized['data']['id']); - $this->assertEquals($this->node->type->entity->uuid(), $normalized['data']['relationships']['type']['data']['id']); $this->assertEquals($this->user->uuid(), $normalized['data']['relationships']['uid']['data']['id']); $this->assertFalse(empty($normalized['included'][0]['id'])); $this->assertTrue(empty($normalized['meta']['errors'])); $this->assertEquals($this->user->uuid(), $normalized['included'][0]['id']); $this->assertCount(1, $normalized['included'][0]['attributes']); - $this->assertCount(8, $normalized['included'][1]['attributes']); + $this->assertCount(6, $normalized['included'][1]['attributes']); // Make sure that the cache tags for the includes and the requested entities // are bubbling as expected. $this->assertArraySubset(