function MigrateUrlAliasTestBase::testUrlAlias
Same name in other branches
- 9 core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php \Drupal\Tests\path\Kernel\Migrate\d7\MigrateUrlAliasTestBase::testUrlAlias()
- 8.9.x core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php \Drupal\Tests\path\Kernel\Migrate\d7\MigrateUrlAliasTestBase::testUrlAlias()
- 10 core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php \Drupal\Tests\path\Kernel\Migrate\d7\MigrateUrlAliasTestBase::testUrlAlias()
Tests the URL alias migration.
File
-
core/
modules/ path/ tests/ src/ Kernel/ Migrate/ d7/ MigrateUrlAliasTestBase.php, line 53
Class
- MigrateUrlAliasTestBase
- Tests URL alias migration.
Namespace
Drupal\Tests\path\Kernel\Migrate\d7Code
public function testUrlAlias() : void {
$path_alias = $this->loadPathAliasByConditions([
'path' => '/taxonomy/term/4',
'alias' => '/term33',
'langcode' => 'und',
]);
$this->assertSame('/taxonomy/term/4', $path_alias->getPath());
$this->assertSame('/term33', $path_alias->getAlias());
$this->assertSame('und', $path_alias->language()
->getId());
// Alias with no slash.
$path_alias = $this->loadPathAliasByConditions([
'alias' => '/source-noSlash',
]);
$this->assertSame('/admin', $path_alias->getPath());
$this->assertSame('und', $path_alias->language()
->getId());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.