From 802d56e8217568e677eb312faabc93cd37ba65be Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Tue, 8 Oct 2024 11:25:28 +0100
Subject: [PATCH] Issue #3475024 by mondrake: Method getMockForAbstractClass()
 is deprecated - replace in class ViewsLocalTaskTest

---
 core/.phpstan-baseline.php                             |  6 ------
 .../src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php  | 10 +++++-----
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index 6a000ff90e21..fb1cfaade122 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -2151,12 +2151,6 @@
 	'count' => 2,
 	'path' => __DIR__ . '/modules/views/tests/src/Kernel/Plugin/StyleTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: method.deprecated
-	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
-	'count' => 5,
-	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php',
-];
 $ignoreErrors[] = [
 	// identifier: method.deprecated
 	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\.$#',
diff --git a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
index f9b941374a23..05cf8840cf60 100644
--- a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
@@ -82,7 +82,7 @@ public function testGetDerivativeDefinitionsWithoutLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->once())
       ->method('getOption')
       ->with('menu')
@@ -137,7 +137,7 @@ public function testGetDerivativeDefinitionsWithLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->once())
       ->method('getOption')
       ->with('menu')
@@ -194,7 +194,7 @@ public function testGetDerivativeDefinitionsWithOverrideRoute(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->once())
       ->method('getOption')
       ->with('menu')
@@ -243,7 +243,7 @@ public function testGetDerivativeDefinitionsWithDefaultLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->exactly(2))
       ->method('getOption')
       ->with('menu')
@@ -316,7 +316,7 @@ public function testGetDerivativeDefinitionsWithExistingLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption', 'getPath'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->exactly(2))
       ->method('getOption')
       ->with('menu')
-- 
GitLab