From 334382d1056923075377faf5ac66e50c9d73a268 Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Fri, 19 Jul 2024 17:51:52 +0900
Subject: [PATCH] Issue #3459750 by mondrake: Method getMockForAbstractClass()
 of class PHPUnit\Framework\TestCase is deprecated in PHPUnit 10 - replace in
 class BuildTestTest

---
 core/.phpstan-baseline.php                                  | 6 ------
 .../Drupal/BuildTests/Framework/Tests/BuildTestTest.php     | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index 062692890548..72c71990c672 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -2367,12 +2367,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: method.deprecated
-	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
-	'count' => 2,
-	'path' => __DIR__ . '/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php',
-];
 $ignoreErrors[] = [
 	'message' => '#^Drupal\\\\Tests\\\\BrowserTestBase\\:\\:\\$defaultTheme is required\\. See https\\://www\\.drupal\\.org/node/3083055, which includes recommendations on which theme to use\\.$#',
 	'count' => 1,
diff --git a/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php b/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
index 119ec0c40cce..6e29abe18ee0 100644
--- a/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
+++ b/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
@@ -93,7 +93,7 @@ public function testCopyCodebaseExclude(): void {
     $base = $this->getMockBuilder(BuildTestBase::class)
       ->onlyMethods(['getDrupalRoot', 'getComposerRoot'])
       ->setConstructorArgs(['test'])
-      ->getMockForAbstractClass();
+      ->getMock();
     $base->expects($this->exactly(1))
       ->method('getDrupalRoot')
       ->willReturn(vfsStream::url('drupal'));
@@ -172,7 +172,7 @@ public function testCopyCodebaseDocRoot(): void {
     $base = $this->getMockBuilder(BuildTestBase::class)
       ->onlyMethods(['getDrupalRoot', 'getComposerRoot'])
       ->setConstructorArgs(['test'])
-      ->getMockForAbstractClass();
+      ->getMock();
     $base->expects($this->exactly(3))
       ->method('getDrupalRoot')
       ->willReturn(vfsStream::url('drupal/docroot'));
-- 
GitLab