diff --git a/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php b/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php index 34a5882..7cf7255 100644 --- a/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php +++ b/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php @@ -66,7 +66,7 @@ public function testCommentFields() { // $this->assertFieldAccess('comment', 'cid', $comment->id()); // $this->assertFieldAccess('comment', 'cid', $comment_anonymous->id()); - // $this->assertFieldAccess('comment', 'uuid', $comment->uuid()); + $this->assertFieldAccess('comment', 'uuid', $comment->uuid()); // $this->assertFieldAccess('comment', 'subject', 'My comment title'); // $this->assertFieldAccess('comment', 'subject', 'Anonymous comment title'); $this->assertFieldAccess('comment', 'name', 'anonymous'); diff --git a/core/modules/field/src/Tests/String/UuidFormatterTest.php b/core/modules/field/src/Tests/String/UuidFormatterTest.php index 2c4f6ef..15956c0 100644 --- a/core/modules/field/src/Tests/String/UuidFormatterTest.php +++ b/core/modules/field/src/Tests/String/UuidFormatterTest.php @@ -15,8 +15,9 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\entity_test\Entity\EntityTest; /** - * Class UuidFormatterTest - * @package Drupal\field\Tests\String + * Tests the output of a UUID field. + * + * @group field */ class UuidFormatterTest extends KernelTestBase { diff --git a/core/modules/file/src/Tests/Views/FileViewsFieldAccessTest.php b/core/modules/file/src/Tests/Views/FileViewsFieldAccessTest.php index 74baac3..94adad3 100644 --- a/core/modules/file/src/Tests/Views/FileViewsFieldAccessTest.php +++ b/core/modules/file/src/Tests/Views/FileViewsFieldAccessTest.php @@ -60,7 +60,7 @@ public function testFileFields() { // @todo Expand the test coverage in https://www.drupal.org/node/2464635 $this->assertFieldAccess('file', 'fid', $file->id()); - // $this->assertFieldAccess('file', 'uuid', $file->uuid()); + $this->assertFieldAccess('file', 'uuid', $file->uuid()); $this->assertFieldAccess('file', 'langcode', $file->language()->getName()); $this->assertFieldAccess('file', 'uid', 'test user'); $this->assertFieldAccess('file', 'filename', $file->getFilename()); diff --git a/core/modules/node/src/Tests/Views/NodeViewsFieldAccessTest.php b/core/modules/node/src/Tests/Views/NodeViewsFieldAccessTest.php index 0ed8edf..93772f9 100644 --- a/core/modules/node/src/Tests/Views/NodeViewsFieldAccessTest.php +++ b/core/modules/node/src/Tests/Views/NodeViewsFieldAccessTest.php @@ -59,7 +59,7 @@ public function testNodeFields() { // @todo Expand the test coverage in https://www.drupal.org/node/2464635 $this->assertFieldAccess('node', 'nid', $node->id()); - // $this->assertFieldAccess('node', 'uuid', $node->uuid()); + $this->assertFieldAccess('node', 'uuid', $node->uuid()); $this->assertFieldAccess('node', 'vid', $node->id()); $this->assertFieldAccess('node', 'type', $node->type->entity->label()); $this->assertFieldAccess('node', 'langcode', $node->language()->getName()); diff --git a/core/modules/user/src/Tests/Views/UserViewsFieldAccessTest.php b/core/modules/user/src/Tests/Views/UserViewsFieldAccessTest.php index f978229..09ee466 100644 --- a/core/modules/user/src/Tests/Views/UserViewsFieldAccessTest.php +++ b/core/modules/user/src/Tests/Views/UserViewsFieldAccessTest.php @@ -57,7 +57,7 @@ public function testUserFields() { // @todo Expand the test coverage in https://www.drupal.org/node/2464635 // $this->assertFieldAccess('user', 'uid', $user->id()); - // $this->assertFieldAccess('user', 'uuid', $user->uuid()); + $this->assertFieldAccess('user', 'uuid', $user->uuid()); $this->assertFieldAccess('user', 'langcode', $user->language()->getName()); $this->assertFieldAccess('user', 'preferred_langcode', 'Spanish'); $this->assertFieldAccess('user', 'preferred_admin_langcode', 'French'); diff --git a/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php b/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php index 44ea708..5554a8a 100644 --- a/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php +++ b/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php @@ -90,7 +90,10 @@ protected function assertFieldAccess($entity_type_id, $field_name, $field_conten $entity_type = \Drupal::entityManager()->getDefinition($entity_type_id); $view_id = $this->randomMachineName(); - $base_table = $entity_type->getDataTable() ?: $entity_type->getBaseTable(); + $data_table = $entity_type->getDataTable(); + // Use the data table as long as the field is not 'uuid'. This is the only + // column that can only be obtained from the base table. + $base_table = ($data_table && ($field_name !== 'uuid')) ? $data_table : $entity_type->getBaseTable(); $entity = View::create([ 'id' => $view_id, 'base_table' => $base_table,