diff --git a/core/modules/comment/src/Plugin/views/field/EntityLink.php b/core/modules/comment/src/Plugin/views/field/EntityLink.php index e37c402e44..e51385876d 100644 --- a/core/modules/comment/src/Plugin/views/field/EntityLink.php +++ b/core/modules/comment/src/Plugin/views/field/EntityLink.php @@ -73,13 +73,12 @@ public function preRender(&$values) { * {@inheritdoc} */ public function render(ResultRow $values) { - $entity = $this->getEntity($values); - if (!$entity) { - return ''; + // Only render the links, if they are defined. + if ($entity = $this->getEntity($values)) { + return !empty($this->build[$entity->id()]['links']['comment__comment']) ? \Drupal::service('renderer')->render($this->build[$entity->id()]['links']['comment__comment']) : ''; } - // Only render the links, if they are defined. - return !empty($this->build[$entity->id()]['links']['comment__comment']) ? \Drupal::service('renderer')->render($this->build[$entity->id()]['links']['comment__comment']) : ''; + return ''; } } diff --git a/core/modules/comment/src/Plugin/views/field/LinkApprove.php b/core/modules/comment/src/Plugin/views/field/LinkApprove.php index 86687f52f0..0cd4734ee8 100644 --- a/core/modules/comment/src/Plugin/views/field/LinkApprove.php +++ b/core/modules/comment/src/Plugin/views/field/LinkApprove.php @@ -19,11 +19,9 @@ class LinkApprove extends LinkBase { * {@inheritdoc} */ protected function getUrlInfo(ResultRow $row) { - $entity = $this->getEntity($row); - if (!$entity) { - return NULL; + if ($entity = $this->getEntity($row)) { + return Url::fromRoute('comment.approve', ['comment' => $entity->id()]); } - return Url::fromRoute('comment.approve', ['comment' => $entity->id()]); } /** diff --git a/core/modules/comment/src/Plugin/views/field/LinkReply.php b/core/modules/comment/src/Plugin/views/field/LinkReply.php index 816f341a6c..5ab91cb9ee 100644 --- a/core/modules/comment/src/Plugin/views/field/LinkReply.php +++ b/core/modules/comment/src/Plugin/views/field/LinkReply.php @@ -20,16 +20,14 @@ class LinkReply extends LinkBase { */ protected function getUrlInfo(ResultRow $row) { /** @var \Drupal\comment\CommentInterface $comment */ - $comment = $this->getEntity($row); - if (!$comment) { - return NULL; + if ($comment = $this->getEntity($row)) { + return Url::fromRoute('comment.reply', [ + 'entity_type' => $comment->getCommentedEntityTypeId(), + 'entity' => $comment->getCommentedEntityId(), + 'field_name' => $comment->getFieldName(), + 'pid' => $comment->id(), + ]); } - return Url::fromRoute('comment.reply', [ - 'entity_type' => $comment->getCommentedEntityTypeId(), - 'entity' => $comment->getCommentedEntityId(), - 'field_name' => $comment->getFieldName(), - 'pid' => $comment->id(), - ]); } /** diff --git a/core/modules/comment/tests/src/Unit/Plugin/views/field/EntityLinkTest.php b/core/modules/comment/tests/src/Unit/Plugin/views/field/EntityLinkTest.php index 4183b6c9d5..d0f3ec5417 100644 --- a/core/modules/comment/tests/src/Unit/Plugin/views/field/EntityLinkTest.php +++ b/core/modules/comment/tests/src/Unit/Plugin/views/field/EntityLinkTest.php @@ -28,4 +28,4 @@ public function testRender() { $this->assertEquals('', $field->render($row)); } -} \ No newline at end of file +} diff --git a/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkApproveTest.php b/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkApproveTest.php index f4f20fa08e..c5787fa838 100644 --- a/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkApproveTest.php +++ b/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkApproveTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\comment\Unit\Plugin\views\field; +use Drupal; use Drupal\comment\Plugin\views\field\LinkApprove; use Drupal\Core\Access\AccessManagerInterface; use Drupal\Core\Entity\EntityRepositoryInterface; @@ -25,8 +26,8 @@ class LinkApproveTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); - \Drupal::setContainer($container); + $container = new ContainerBuilder(); + Drupal::setContainer($container); } /** @@ -36,7 +37,7 @@ public function testRender() { $row = new ResultRow(); $container = new ContainerBuilder(); $container->set('string_translation', $this->createMock(TranslationInterface::class)); - \Drupal::setContainer($container); + Drupal::setContainer($container); $field = new LinkApprove([], '', [], $this->createMock(AccessManagerInterface::class), $this->createMock(EntityTypeManagerInterface::class), $this->createMock(EntityRepositoryInterface::class), $this->createMock(LanguageManagerInterface::class)); $view = $this->createMock(ViewExecutable::class); $display = $this->createMock(DisplayPluginBase::class); @@ -44,4 +45,4 @@ public function testRender() { $this->assertEquals('', $field->render($row)); } -} \ No newline at end of file +} diff --git a/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkReplyTest.php b/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkReplyTest.php index 0cbe8557b9..76dfd0f503 100644 --- a/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkReplyTest.php +++ b/core/modules/comment/tests/src/Unit/Plugin/views/field/LinkReplyTest.php @@ -25,7 +25,7 @@ class LinkReplyTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } @@ -44,4 +44,4 @@ public function testRender() { $this->assertEquals('', $field->render($row)); } -} \ No newline at end of file +} diff --git a/core/modules/contact/src/Plugin/views/field/ContactLink.php b/core/modules/contact/src/Plugin/views/field/ContactLink.php index af72aa3313..b2f9e66c10 100644 --- a/core/modules/contact/src/Plugin/views/field/ContactLink.php +++ b/core/modules/contact/src/Plugin/views/field/ContactLink.php @@ -30,19 +30,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { * {@inheritdoc} */ protected function getUrlInfo(ResultRow $row) { - $entity = $this->getEntity($row); - if (!$entity) { - return NULL; + if ($entity = $this->getEntity($row)) { + return Url::fromRoute('entity.user.contact_form', ['user' => $entity->id()]); } - return Url::fromRoute('entity.user.contact_form', ['user' => $entity->id()]); } /** * {@inheritdoc} */ protected function renderLink(ResultRow $row) { - $entity = $this->getEntity($row); - if (!$entity) { + if (!$entity = $this->getEntity($row)) { return ''; } diff --git a/core/modules/contact/tests/src/Unit/ContactLinkTest.php b/core/modules/contact/tests/src/Unit/ContactLinkTest.php index 98e6953441..511720ae12 100644 --- a/core/modules/contact/tests/src/Unit/ContactLinkTest.php +++ b/core/modules/contact/tests/src/Unit/ContactLinkTest.php @@ -25,7 +25,7 @@ class ContactLinkTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } @@ -44,4 +44,4 @@ public function testRender() { $this->assertEquals('', $field->render($row)); } -} \ No newline at end of file +} diff --git a/core/modules/media_library/tests/src/Unit/MediaLibrarySelectFormTest.php b/core/modules/media_library/tests/src/Unit/MediaLibrarySelectFormTest.php index f22bdd975f..bb11340623 100644 --- a/core/modules/media_library/tests/src/Unit/MediaLibrarySelectFormTest.php +++ b/core/modules/media_library/tests/src/Unit/MediaLibrarySelectFormTest.php @@ -3,11 +3,15 @@ namespace Drupal\Tests\media_library\Unit; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\media_library\Plugin\views\field\MediaLibrarySelectForm; use Drupal\Tests\UnitTestCase; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\HttpFoundation\ParameterBag; +use Symfony\Component\HttpFoundation\Request; /** * @coversDefaultClass \Drupal\media_library\Plugin\views\field\MediaLibrarySelectForm @@ -23,7 +27,35 @@ class MediaLibrarySelectFormTest extends UnitTestCase { public function testViewsForm() { $row = new ResultRow(); $field = new MediaLibrarySelectForm([], '', []); - $view = $this->createMock(ViewExecutable::class); + + $container = new ContainerBuilder(); + $container->set('string_translation', $this->createMock(TranslationInterface::class)); + \Drupal::setContainer($container); + + $query = $this->getMockBuilder(ParameterBag::class) + ->setMethods(['all']) + ->disableOriginalConstructor() + ->getMock(); + $query->expects($this->any()) + ->method('all') + ->willReturn([]); + + $request = $this->getMockBuilder(Request::class) + ->disableOriginalConstructor() + ->getMock(); + $request->query = $query; + + $view = $this->getMockBuilder(ViewExecutable::class) + ->setMethods(['getRequest', 'initStyle']) + ->disableOriginalConstructor() + ->getMock(); + $view->expects($this->any()) + ->method('getRequest') + ->willReturn($request); + $view->expects($this->any()) + ->method('initStyle') + ->willReturn(TRUE); + $display = $this->createMock(DisplayPluginBase::class); $form_state = $this->createMock(FormStateInterface::class); $view->result = [$row]; @@ -33,4 +65,4 @@ public function testViewsForm() { $this->assertNotEmpty($form); } -} \ No newline at end of file +} diff --git a/core/modules/node/src/Plugin/views/field/RevisionLink.php b/core/modules/node/src/Plugin/views/field/RevisionLink.php index ce6b235ba7..e6ca12a464 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLink.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLink.php @@ -20,14 +20,15 @@ class RevisionLink extends LinkBase { */ protected function getUrlInfo(ResultRow $row) { /** @var \Drupal\node\NodeInterface $node */ - $node = $this->getEntity($row); - if (!$node) { - return NULL; + if ($node = $this->getEntity($row)) { + // Current revision uses the node view path. + return !$node->isDefaultRevision() ? + Url::fromRoute('entity.node.revision', [ + 'node' => $node->id(), + 'node_revision' => $node->getRevisionId() + ]) : + $node->toUrl(); } - // Current revision uses the node view path. - return !$node->isDefaultRevision() ? - Url::fromRoute('entity.node.revision', ['node' => $node->id(), 'node_revision' => $node->getRevisionId()]) : - $node->toUrl(); } /** diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php index 8f92a2ee1b..301658ad9f 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php @@ -19,11 +19,12 @@ class RevisionLinkDelete extends RevisionLink { */ protected function getUrlInfo(ResultRow $row) { /** @var \Drupal\node\NodeInterface $node */ - $node = $this->getEntity($row); - if (!$node) { - return NULL; + if ($node = $this->getEntity($row)) { + return Url::fromRoute('node.revision_delete_confirm', [ + 'node' => $node->id(), + 'node_revision' => $node->getRevisionId(), + ]); } - return Url::fromRoute('node.revision_delete_confirm', ['node' => $node->id(), 'node_revision' => $node->getRevisionId()]); } /** diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php index 7c6c10f8b3..5b40a2b12f 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php @@ -19,11 +19,12 @@ class RevisionLinkRevert extends RevisionLink { */ protected function getUrlInfo(ResultRow $row) { /** @var \Drupal\node\NodeInterface $node */ - $node = $this->getEntity($row); - if (!$node) { - return NULL; + if ($node = $this->getEntity($row)) { + return Url::fromRoute('node.revision_revert_confirm', [ + 'node' => $node->id(), + 'node_revision' => $node->getRevisionId() + ]); } - return Url::fromRoute('node.revision_revert_confirm', ['node' => $node->id(), 'node_revision' => $node->getRevisionId()]); } /** diff --git a/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkDeleteTest.php b/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkDeleteTest.php index 5ec16dc1e4..370fc7c6b2 100644 --- a/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkDeleteTest.php +++ b/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkDeleteTest.php @@ -7,7 +7,6 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\StringTranslation\TranslationInterface; -use Drupal\node\Plugin\views\field\RevisionLink; use Drupal\node\Plugin\views\field\RevisionLinkDelete; use Drupal\Tests\UnitTestCase; use Drupal\views\Plugin\views\display\DisplayPluginBase; @@ -26,7 +25,7 @@ class RevisionLinkDeleteTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } diff --git a/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkRevertTest.php b/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkRevertTest.php index c07d5cf8df..9b0ee88562 100644 --- a/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkRevertTest.php +++ b/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkRevertTest.php @@ -7,7 +7,6 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\StringTranslation\TranslationInterface; -use Drupal\node\Plugin\views\field\RevisionLink; use Drupal\node\Plugin\views\field\RevisionLinkDelete; use Drupal\Tests\UnitTestCase; use Drupal\views\Plugin\views\display\DisplayPluginBase; @@ -26,7 +25,7 @@ class RevisionLinkRevertTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } diff --git a/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkTest.php b/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkTest.php index 5e0c5bae24..4c0235fa15 100644 --- a/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkTest.php +++ b/core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkTest.php @@ -25,7 +25,7 @@ class RevisionLinkTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } diff --git a/core/modules/user/src/Plugin/views/field/Permissions.php b/core/modules/user/src/Plugin/views/field/Permissions.php index 8409f1da64..ff77b3102d 100644 --- a/core/modules/user/src/Plugin/views/field/Permissions.php +++ b/core/modules/user/src/Plugin/views/field/Permissions.php @@ -87,8 +87,7 @@ public function preRender(&$values) { $rids = []; foreach ($values as $result) { - $user = $this->getEntity($result); - if (!$user) { + if (!$user = $this->getEntity($result)) { continue; } $user_rids = $user->getRoles(); diff --git a/core/modules/user/tests/src/Unit/Plugin/views/field/PermissionsTest.php b/core/modules/user/tests/src/Unit/Plugin/views/field/PermissionsTest.php index ed4a4ef906..00967204f7 100644 --- a/core/modules/user/tests/src/Unit/Plugin/views/field/PermissionsTest.php +++ b/core/modules/user/tests/src/Unit/Plugin/views/field/PermissionsTest.php @@ -2,12 +2,8 @@ namespace Drupal\Tests\user\Unit\Plugin\views\field; -use Drupal\contact\Plugin\views\field\ContactLink; -use Drupal\Core\Access\AccessManagerInterface; -use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Tests\UnitTestCase; use Drupal\user\PermissionHandlerInterface; @@ -28,7 +24,7 @@ class PermissionsTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } diff --git a/core/modules/views/src/Plugin/views/field/LinkBase.php b/core/modules/views/src/Plugin/views/field/LinkBase.php index b1b1e9f0fb..bce83c2780 100644 --- a/core/modules/views/src/Plugin/views/field/LinkBase.php +++ b/core/modules/views/src/Plugin/views/field/LinkBase.php @@ -195,11 +195,9 @@ public function render(ResultRow $row) { * The access result. */ protected function checkUrlAccess(ResultRow $row) { - $url = $this->getUrlInfo($row); - if (!$url) { - return NULL; + if ($url = $this->getUrlInfo($row)) { + return $this->accessManager->checkNamedRoute($url->getRouteName(), $url->getRouteParameters(), $this->currentUser(), TRUE); } - return $this->accessManager->checkNamedRoute($url->getRouteName(), $url->getRouteParameters(), $this->currentUser(), TRUE); } /** @@ -239,8 +237,7 @@ protected function renderLink(ResultRow $row) { * A view result row. */ protected function addLangcode(ResultRow $row) { - $entity = $this->getEntity($row); - if ($this->languageManager->isMultilingual()) { + if (($entity = $this->getEntity($row)) && $this->languageManager->isMultilingual()) { $this->options['alter']['language'] = $this->getEntityTranslation($entity, $row)->language(); } } diff --git a/core/modules/views/src/Plugin/views/field/RenderedEntity.php b/core/modules/views/src/Plugin/views/field/RenderedEntity.php index 4539866605..9cfd16ae96 100644 --- a/core/modules/views/src/Plugin/views/field/RenderedEntity.php +++ b/core/modules/views/src/Plugin/views/field/RenderedEntity.php @@ -147,7 +147,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { */ public function render(ResultRow $values) { if (!$entity = $this->getEntity($values)) { - return []; + return ''; } $entity = $this->getEntityTranslation($entity, $values); $build = []; diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php index d6e124c1cd..1f28bcac9d 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php @@ -69,11 +69,23 @@ protected function setUpFixtures() { */ public function testEntityLink() { // Anonymous users cannot see edit/delete links. - $expected_results = ['canonical' => TRUE, 'edit-form' => FALSE, 'delete-form' => FALSE, 'canonical_raw' => TRUE, 'canonical_raw_absolute' => TRUE]; + $expected_results = [ + 'canonical' => TRUE, + 'edit-form' => FALSE, + 'delete-form' => FALSE, + 'canonical_raw' => TRUE, + 'canonical_raw_absolute' => TRUE, + ]; $this->doTestEntityLink(\Drupal::currentUser(), $expected_results); // Admin users cannot see all links. - $expected_results = ['canonical' => TRUE, 'edit-form' => TRUE, 'delete-form' => TRUE, 'canonical_raw' => TRUE, 'canonical_raw_absolute' => TRUE]; + $expected_results = [ + 'canonical' => TRUE, + 'edit-form' => TRUE, + 'delete-form' => TRUE, + 'canonical_raw' => TRUE, + 'canonical_raw_absolute' => TRUE, + ]; $this->doTestEntityLink($this->adminUser, $expected_results); } @@ -137,7 +149,8 @@ protected function doTestEntityLink(AccountInterface $account, $expected_results foreach ($expected_results as $template => $expected_result) { $expected_link = ''; if ($expected_result) { - $path = $entity->toUrl($info[$template]['relationship'], $info[$template]['options'])->toString(); + $path = $entity->toUrl($info[$template]['relationship'], $info[$template]['options']) + ->toString(); $destination = $info[$template]['destination'] ? '?destination=/' : ''; if ($info[$template]['link']) { $expected_link = '' . $info[$template]['label'] . ''; diff --git a/core/modules/views/tests/src/Unit/Plugin/views/field/BulkFormTest.php b/core/modules/views/tests/src/Unit/Plugin/views/field/BulkFormTest.php index 857de5c735..2b8b8dd47a 100644 --- a/core/modules/views/tests/src/Unit/Plugin/views/field/BulkFormTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/views/field/BulkFormTest.php @@ -22,7 +22,7 @@ class BulkFormTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } diff --git a/core/modules/views/tests/src/Unit/Plugin/views/field/LinkBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/views/field/LinkBaseTest.php index e64cc3abbd..02b65c93f8 100644 --- a/core/modules/views/tests/src/Unit/Plugin/views/field/LinkBaseTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/views/field/LinkBaseTest.php @@ -26,7 +26,7 @@ class LinkBaseTest extends UnitTestCase { */ protected function tearDown() { parent::tearDown(); - $container = new \Drupal\Core\DependencyInjection\ContainerBuilder(); + $container = new ContainerBuilder(); \Drupal::setContainer($container); } @@ -45,7 +45,15 @@ public function testRender() { ->method('isMultilingual') ->willReturn(TRUE); $field = $this->getMockBuilder(LinkBase::class) - ->setConstructorArgs([[], 'foo', [], $this->createMock(AccessManagerInterface::class), $this->createMock(EntityTypeManagerInterface::class), $this->createMock(EntityRepositoryInterface::class), $languageManager]) + ->setConstructorArgs([ + [], + 'foo', + [], + $this->createMock(AccessManagerInterface::class), + $this->createMock(EntityTypeManagerInterface::class), + $this->createMock(EntityRepositoryInterface::class), + $languageManager, + ]) ->setMethods(['checkUrlAccess', 'getUrlInfo']) ->getMock(); $field->expects($this->any()) diff --git a/core/modules/views/tests/src/Unit/Plugin/views/field/RenderedEntityTest.php b/core/modules/views/tests/src/Unit/Plugin/views/field/RenderedEntityTest.php index 403d6c7d46..3943c462d1 100644 --- a/core/modules/views/tests/src/Unit/Plugin/views/field/RenderedEntityTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/views/field/RenderedEntityTest.php @@ -2,23 +2,15 @@ namespace Drupal\Tests\views\Unit\Plugin\views\field; -use Drupal\Core\Access\AccessManagerInterface; -use Drupal\Core\Access\AccessResultAllowed; -use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageManagerInterface; -use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Tests\UnitTestCase; use Drupal\views\Plugin\views\display\DisplayPluginBase; -use Drupal\views\Plugin\views\field\EntityLink; -use Drupal\views\Plugin\views\field\LinkBase; use Drupal\views\Plugin\views\field\RenderedEntity; use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; -use Symfony\Component\DependencyInjection\ContainerBuilder; /** * @coversDefaultClass \Drupal\views\Plugin\views\field\RenderedEntity