function LanguageDomainsTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php \Drupal\Tests\language\Unit\process\LanguageDomainsTest::setUp()
  2. 8.9.x core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php \Drupal\Tests\language\Unit\process\LanguageDomainsTest::setUp()
  3. 10 core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php \Drupal\Tests\language\Unit\process\LanguageDomainsTest::setUp()

Overrides MigrateProcessTestCase::setUp

File

core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php, line 19

Class

LanguageDomainsTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21language%21src%21Plugin%21migrate%21process%21LanguageDomains.php/class/LanguageDomains/11.x" title="This plugin makes sure that no domain is empty if domain negotiation is used." class="local">\Drupal\language\Plugin\migrate\process\LanguageDomains</a> @group language

Namespace

Drupal\Tests\language\Unit\process

Code

protected function setUp() : void {
    $configuration = [
        'key' => 'language',
        'value' => 'domain',
    ];
    $this->plugin = new LanguageDomains($configuration, 'map', []);
    parent::setUp();
    // The language_domains plugin calls getSourceProperty() to check if domain
    // negotiation is used. If it is the values will be processed so we need it
    // to return TRUE to be able to test the process.
    $this->row
        ->expects($this->once())
        ->method('getSourceProperty')
        ->willReturn(TRUE);
    // The language_domains plugin use $base_url to fill empty domains.
    global $base_url;
    $base_url = 'http://example.com';
}

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