Verified Commit 6dd0db56 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3281535 by mondrake, daffie: Fix 'Access to an undefined property'...

Issue #3281535 by mondrake, daffie: Fix 'Access to an undefined property' PHPStan L0 errors in test code
parent b8a325c3
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -59,18 +59,6 @@ protected function setUp(): void {
      'edit own book content',
      'add content to books',
    ]);
    $this->adminUser = $this->drupalCreateUser([
      'create new books',
      'create book content',
      'edit any book content',
      'delete any book content',
      'add content to books',
      'administer blocks',
      'administer permissions',
      'administer book outlines',
      'administer content types',
      'administer site configuration',
    ]);
  }

  /**
+10 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
use Drupal\editor\Entity\Editor;
use Drupal\Tests\BrowserTestBase;
use Drupal\Component\Serialization\Json;
use Drupal\user\Entity\User;

/**
 * Tests CKEditor toolbar buttons when the language direction is RTL.
@@ -26,6 +27,13 @@ class CKEditorToolbarButtonTest extends BrowserTestBase {
   */
  protected $defaultTheme = 'stark';

  /**
   * The admin user.
   *
   * @var \Drupal\user\Entity\User
   */
  protected User $adminUser;

  /**
   * {@inheritdoc}
   */
@@ -45,7 +53,7 @@ protected function setUp(): void {
    ])->save();

    // Create a new user with admin rights.
    $this->admin_user = $this->drupalCreateUser([
    $this->adminUser = $this->drupalCreateUser([
      'administer languages',
      'access administration pages',
      'administer site configuration',
@@ -57,7 +65,7 @@ protected function setUp(): void {
   * Method tests CKEditor image buttons.
   */
  public function testImageButtonDisplay() {
    $this->drupalLogin($this->admin_user);
    $this->drupalLogin($this->adminUser);

    // Install the Arabic language (which is RTL) and configure as the default.
    $edit = [];
+15 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\RoleInterface;
use Drupal\user\Entity\User;
use Symfony\Component\Validator\ConstraintViolation;

/**
@@ -29,6 +30,20 @@ class AddedStylesheetsTest extends BrowserTestBase {
   */
  protected $defaultTheme = 'stark';

  /**
   * The editor user.
   *
   * @var \Drupal\editor\Entity\Editor
   */
  protected Editor $editor;

  /**
   * The admin user.
   *
   * @var \Drupal\user\Entity\User
   */
  protected User $adminUser;

  /**
   * {@inheritdoc}
   */
+8 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\RoleInterface;
use Drupal\user\Entity\User;
use Symfony\Component\Validator\ConstraintViolation;

/**
@@ -31,6 +32,13 @@ class CKEditor5QuickEditLibraryTest extends BrowserTestBase {
   */
  protected $defaultTheme = 'stark';

  /**
   * The admin user.
   *
   * @var \Drupal\user\Entity\User
   */
  protected User $adminUser;

  /**
   * {@inheritdoc}
   */
+8 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
use Drupal\Tests\media\Traits\MediaTypeCreationTrait;
use Drupal\Tests\TestFileCreationTrait;
use Drupal\user\RoleInterface;
use Drupal\user\Entity\User;
use Symfony\Component\Validator\ConstraintViolation;

/**
@@ -67,6 +68,13 @@ class MediaEntityMetadataApiTest extends BrowserTestBase {
   */
  protected $editor;

  /**
   * The admin user.
   *
   * @var \Drupal\user\Entity\User
   */
  protected User $adminUser;

  /**
   * @var \Drupal\Component\Uuid\UuidInterface
   */
Loading