diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
index 6378543648f..f1635f29a72 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@@ -337,7 +337,7 @@ class FieldPluginBaseTest extends UnitTestCase {
* @return array
* Test data.
*/
- public function providerTestRenderAsLinkWithPathAndOptions() {
+ public static function providerTestRenderAsLinkWithPathAndOptions() {
$data = [];
// Simple path with default options.
$data[] = ['test-path', [], 'value'];
@@ -363,8 +363,7 @@ class FieldPluginBaseTest extends UnitTestCase {
// executed for paths which aren't routed.
// Entity flag.
- $entity = $this->createMock('Drupal\Core\Entity\EntityInterface');
- $data[] = ['test-path', ['entity' => $entity], 'value'];
+ $data[] = ['test-path', ['entity' => new \stdClass()], 'value'];
// entity_type flag.
$entity_type_id = 'node';
$data[] = ['test-path', ['entity_type' => $entity_type_id], 'value'];