FastTest.php

Same filename in other branches
  1. 9 core/modules/system/tests/src/Functional/Theme/FastTest.php
  2. 8.9.x core/modules/system/tests/src/Functional/Theme/FastTest.php
  3. 10 core/modules/system/tests/src/Functional/Theme/FastTest.php

Namespace

Drupal\Tests\system\Functional\Theme

File

core/modules/system/tests/src/Functional/Theme/FastTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\system\Functional\Theme;

use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\User;

/**
 * Tests autocompletion not loading registry.
 *
 * @group Theme
 */
class FastTest extends BrowserTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'theme_test',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected $defaultTheme = 'stark';
    
    /**
     * User allowed to access use profiles.
     *
     * @var \Drupal\user\Entity\User
     */
    protected User $account;
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->account = $this->drupalCreateUser([
            'access user profiles',
        ]);
    }
    
    /**
     * Tests access to user autocompletion and verify the correct results.
     */
    public function testUserAutocomplete() : void {
        $this->drupalLogin($this->account);
        $this->drupalGet('user/autocomplete', [
            'query' => [
                'q' => $this->account
                    ->getAccountName(),
            ],
        ]);
        $this->assertSession()
            ->responseContains($this->account
            ->getAccountName());
        $this->assertSession()
            ->pageTextNotContains('registry initialized');
    }

}

Classes

Title Deprecated Summary
FastTest Tests autocompletion not loading registry.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.