class MigrateUrlAliasTestBase
Same name and namespace in other branches
- 11.x core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php \Drupal\Tests\path\Kernel\Migrate\d7\MigrateUrlAliasTestBase
- 10 core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php \Drupal\Tests\path\Kernel\Migrate\d7\MigrateUrlAliasTestBase
- 8.9.x core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php \Drupal\Tests\path\Kernel\Migrate\d7\MigrateUrlAliasTestBase
Tests URL alias migration.
@group path
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase extends \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait extends \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\path\Kernel\Migrate\d7\MigrateUrlAliasTestBase uses \Drupal\Tests\Traits\Core\PathAliasTestTrait extends \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait extends \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase extends \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateUrlAliasTestBase
File
-
core/
modules/ path/ tests/ src/ Kernel/ Migrate/ d7/ MigrateUrlAliasTestBase.php, line 13
Namespace
Drupal\Tests\path\Kernel\Migrate\d7View source
abstract class MigrateUrlAliasTestBase extends MigrateDrupal7TestBase {
use PathAliasTestTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'language',
'menu_ui',
'node',
'path',
'path_alias',
'text',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installEntitySchema('node');
$this->installEntitySchema('path_alias');
$this->installConfig('node');
$this->installSchema('node', [
'node_access',
]);
$this->migrateUsers(FALSE);
$this->migrateContentTypes();
$this->executeMigrations([
'language',
'd7_node',
]);
}
/**
* Tests the URL alias migration.
*/
public function testUrlAlias() {
$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.