Verified Commit 15cb2ff8 authored by godotislate's avatar godotislate
Browse files

task: #3620948 [November 2026] Refactor test code via Rector

By: mondrake
By: dcam
By: godotislate
By: mstrelan
parent 4f15bfbd
Loading
Loading
Loading
Loading
Loading
−204

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Changes for core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaViewModeTest.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

namespace Drupal\Tests\ckeditor5\FunctionalJavascript;

use Drupal\ckeditor5\Plugin\CKEditor5Plugin\Media;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\Core\Entity\Entity\EntityViewMode;
use Drupal\filter\Entity\FilterFormat;
@@ -19,7 +20,7 @@
 *
 * @internal
 */
#[CoversClass(\Drupal\ckeditor5\Plugin\CKEditor5Plugin\Media::class)]
#[CoversClass(Media::class)]
#[Group('ckeditor5')]
#[Group('#slow')]
#[RunTestsInSeparateProcesses]
−4
Changes for core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php: 0 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -12,10 +12,8 @@
use Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemDependencyConstraintValidator;
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\Entity\EntityViewMode;
use Drupal\editor\EditorInterface;
use Drupal\editor\Entity\Editor;
use Drupal\filter\Entity\FilterFormat;
use Drupal\filter\FilterFormatInterface;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\SchemaCheckTestTrait;
use PHPUnit\Framework\Attributes\CoversClass;
@@ -703,11 +701,9 @@ public function testPair(array $ckeditor5_settings, array $editor_image_upload_s
      'enabled' => TRUE,
      'label' => 'View Mode 2',
    ])->save();
    assert($text_editor instanceof EditorInterface);
    $text_format = FilterFormat::create([
      'filters' => $filters,
    ]);
    assert($text_format instanceof FilterFormatInterface);
    // TRICKY: because we're validating using `editor.editor.*` as the config
    // name, TextEditorObjectDependentValidatorTrait will load the stored
    // filter format. That has not yet been updated at this point, so in order
−1
Changes for core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -141,7 +141,6 @@ public function testViewMode(): void {
    // Check that the comment view display entity has been deleted too.
    $this->assertNull(EntityViewDisplay::load($comment_display_id));

    /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */
    $host_display = EntityViewDisplay::load($host_display_id);

    // Check that the field formatter has been disabled on host view display.
+4 −6
Changes for core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php: 4 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

use Drupal\comment\CommentStatistics;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Query\Select;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Session\AccountInterface;
@@ -14,6 +15,7 @@
use Drupal\Tests\UnitTestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;

/**
 * Tests Drupal\comment\CommentStatistics.
@@ -38,10 +40,8 @@ class CommentStatisticsUnitTest extends UnitTestCase {

  /**
   * Mock database connection.
   *
   * @var \Drupal\Core\Database\Connection
   */
  protected $database;
  protected Connection&MockObject $database;

  /**
   * CommentStatistics service under test.
@@ -82,9 +82,7 @@ protected function setUp(): void {
      ->method('execute')
      ->willReturn($this->statement);

    $this->database = $this->getMockBuilder('Drupal\Core\Database\Connection')
      ->disableOriginalConstructor()
      ->getMock();
    $this->database = $this->createMock(Connection::class);

    $this->database->expects($this->once())
      ->method('select')
Loading