function PathNoCanonicalLinkTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php \Drupal\Tests\path\Kernel\PathNoCanonicalLinkTest::setUp()
  2. 10 core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php \Drupal\Tests\path\Kernel\PathNoCanonicalLinkTest::setUp()
  3. 11.x core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php \Drupal\Tests\path\Kernel\PathNoCanonicalLinkTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php, line 30

Class

PathNoCanonicalLinkTest
Tests path alias deletion when there is no canonical link template.

Namespace

Drupal\Tests\path\Kernel

Code

protected function setUp() {
    parent::setUp();
    $this->installEntitySchema('entity_test');
    $this->installEntitySchema('entity_test_mul');
    \Drupal::service('router.builder')->rebuild();
    // Adding german language.
    ConfigurableLanguage::create([
        'id' => 'de',
    ])->save();
    $this->config('language.types')
        ->setData([
        'configurable' => [
            'language_interface',
        ],
        'negotiation' => [
            'language_interface' => [
                'enabled' => [
                    'language-url' => 0,
                ],
            ],
        ],
    ])
        ->save();
}

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