Verified Commit 11103e23 authored by quietone's avatar quietone
Browse files

Issue #3480419 by mondrake, smustgrave, catch: Method...

Issue #3480419 by mondrake, smustgrave, catch: Method getMockForAbstractClass() is deprecated - replace in views plugins

(cherry picked from commit 88413a56)
parent 4e64f397
Loading
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -52893,12 +52893,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php',
];
$ignoreErrors[] = [
	// identifier: method.deprecated
	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Function Drupal\\\\views\\\\Plugin\\\\views\\\\field\\\\base_path\\(\\) has no return type specified\\.$#',
@@ -52935,30 +52929,12 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/field/FieldTest.php',
];
$ignoreErrors[] = [
	// identifier: method.deprecated
	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Unit\\\\Plugin\\\\pager\\\\PagerPluginBaseTest\\:\\:providerTestHasMoreRecords\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php',
];
$ignoreErrors[] = [
	// identifier: method.deprecated
	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/pager/SqlBaseTest.php',
];
$ignoreErrors[] = [
	// identifier: method.deprecated
	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Unit\\\\Plugin\\\\views\\\\query\\\\MysqlDateSqlTest\\:\\:providerTestGetDateFormat\\(\\) has no return type specified\\.$#',
+1 −1
Original line number Diff line number Diff line
@@ -576,7 +576,7 @@ protected function setupViewExecutableAccessPlugin(): array {

    $access_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\access\AccessPluginBase')
      ->disableOriginalConstructor()
      ->getMockForAbstractClass();
      ->getMock();
    $this->accessPluginManager->expects($this->any())
      ->method('createInstance')
      ->willReturn($access_plugin);
+3 −2
Original line number Diff line number Diff line
@@ -27,9 +27,10 @@ class PagerPluginBaseTest extends UnitTestCase {
  protected function setUp(): void {
    parent::setUp();

    $this->pager = $this->getMockBuilder('Drupal\views\Plugin\views\pager\PagerPluginBase')
    $this->pager = $this->getMockBuilder(StubPagerPluginBase::class)
      ->disableOriginalConstructor()
      ->getMockForAbstractClass();
      ->onlyMethods([])
      ->getMock();

    $view = $this->getMockBuilder('Drupal\views\ViewExecutable')
      ->disableOriginalConstructor()
+3 −2
Original line number Diff line number Diff line
@@ -39,9 +39,10 @@ class SqlBaseTest extends UnitTestCase {
  protected function setUp(): void {
    parent::setUp();

    $this->pager = $this->getMockBuilder('Drupal\views\Plugin\views\pager\SqlBase')
    $this->pager = $this->getMockBuilder(StubSqlBase::class)
      ->disableOriginalConstructor()
      ->getMockForAbstractClass();
      ->onlyMethods([])
      ->getMock();

    $this->view = $this->getMockBuilder('Drupal\views\ViewExecutable')
      ->disableOriginalConstructor()
+13 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Drupal\Tests\views\Unit\Plugin\pager;

use Drupal\views\Plugin\views\pager\PagerPluginBase;

/**
 * A stub pager plugin for testing purposes.
 */
class StubPagerPluginBase extends PagerPluginBase {
}
Loading