MigrateUrlAliasTest.php in Drupal 9
File
core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTest.php
View source
<?php
namespace Drupal\Tests\path\Kernel\Migrate\d7;
class MigrateUrlAliasTest extends MigrateUrlAliasTestBase {
protected static $modules = [
'path_alias',
'content_translation',
'migrate_drupal_multilingual',
];
protected function setUp() : void {
parent::setUp();
$this
->executeMigrations([
'd7_node_translation',
'd7_url_alias',
]);
}
public function testUrlAliasWithTranslatedNodes() {
$path_alias = $this
->loadPathAliasByConditions([
'alias' => '/deep-space-9',
]);
$this
->assertSame('/node/2', $path_alias
->getPath());
$this
->assertSame('en', $path_alias
->get('langcode')->value);
$path_alias = $this
->loadPathAliasByConditions([
'alias' => '/deep-space-9-is',
]);
$this
->assertSame('/node/2', $path_alias
->getPath());
$this
->assertSame('is', $path_alias
->get('langcode')->value);
$path_alias = $this
->loadPathAliasByConditions([
'alias' => '/firefly-is',
]);
$this
->assertSame('/node/4', $path_alias
->getPath());
$this
->assertSame('is', $path_alias
->get('langcode')->value);
$path_alias = $this
->loadPathAliasByConditions([
'alias' => '/firefly',
]);
$this
->assertSame('/node/4', $path_alias
->getPath());
$this
->assertSame('en', $path_alias
->get('langcode')->value);
}
}