function LanguageNegotiationUrlTest::setUp

Same name in this branch
  1. 11.x core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php \Drupal\Tests\language\Unit\LanguageNegotiationUrlTest::setUp()
Same name and namespace in other branches
  1. 9 core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php \Drupal\Tests\language\Unit\LanguageNegotiationUrlTest::setUp()
  2. 9 core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php \Drupal\Tests\language\Functional\LanguageNegotiationUrlTest::setUp()
  3. 8.9.x core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php \Drupal\Tests\language\Unit\LanguageNegotiationUrlTest::setUp()
  4. 8.9.x core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php \Drupal\Tests\language\Functional\LanguageNegotiationUrlTest::setUp()
  5. 10 core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php \Drupal\Tests\language\Unit\LanguageNegotiationUrlTest::setUp()
  6. 10 core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php \Drupal\Tests\language\Functional\LanguageNegotiationUrlTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php, line 37

Class

LanguageNegotiationUrlTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21language%21src%21Plugin%21LanguageNegotiation%21LanguageNegotiationUrl.php/class/LanguageNegotiationUrl/11.x" title="Class for identifying language via URL prefix or domain." class="local">\Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl</a> @group language

Namespace

Drupal\Tests\language\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Create an Article node type.
    if ($this->profile != 'standard') {
        $this->drupalCreateContentType([
            'type' => 'article',
        ]);
    }
    $this->user = $this->drupalCreateUser([
        'administer languages',
        'access administration pages',
        'view the administration theme',
        'administer nodes',
        'create article content',
        'create url aliases',
    ]);
    $this->drupalLogin($this->user);
    $this->drupalGet('admin/config/regional/language/add');
    $this->submitForm([
        'predefined_langcode' => 'de',
    ], 'Add language');
}

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