public function LanguageDomainsTest::testTransform in Drupal 9
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php \Drupal\Tests\language\Unit\process\LanguageDomainsTest::testTransform()
@covers ::transform
File
- core/
modules/ language/ tests/ src/ Unit/ process/ LanguageDomainsTest.php, line 45
Class
- LanguageDomainsTest
- @coversDefaultClass \Drupal\language\Plugin\migrate\process\LanguageDomains @group language
Namespace
Drupal\Tests\language\Unit\processCode
public function testTransform() {
$source = [
[
'language' => 'en',
'domain' => '',
],
[
'language' => 'fr',
'domain' => 'fr.example.com',
],
[
'language' => 'es',
'domain' => 'http://es.example.com',
],
[
'language' => 'hu',
'domain' => 'https://hu.example.com',
],
];
$expected = [
'en' => 'example.com',
'fr' => 'fr.example.com',
'es' => 'es.example.com',
'hu' => 'hu.example.com',
];
$value = $this->plugin
->transform($source, $this->migrateExecutable, $this->row, 'destination_property');
$this
->assertSame($value, $expected);
}