class MigrateMenuTest
Same name in this branch
- 9 core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php \Drupal\Tests\system\Kernel\Migrate\d7\MigrateMenuTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Kernel/Migrate/d6/MigrateMenuTest.php \Drupal\Tests\system\Kernel\Migrate\d6\MigrateMenuTest
- 11.x core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php \Drupal\Tests\system\Kernel\Migrate\d7\MigrateMenuTest
Upgrade menus to system.menu.*.yml.
@group migrate_drupal_6
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \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 implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\system\Kernel\Migrate\d6\MigrateMenuTest implements \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateMenuTest
File
-
core/
modules/ system/ tests/ src/ Kernel/ Migrate/ d6/ MigrateMenuTest.php, line 14
Namespace
Drupal\Tests\system\Kernel\Migrate\d6View source
class MigrateMenuTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->executeMigration('d6_menu');
}
/**
* Tests the Drupal 6 menu to Drupal 8 migration.
*/
public function testMenu() {
$navigation_menu = Menu::load('navigation');
$this->assertSame('navigation', $navigation_menu->id());
$this->assertSame('Navigation', $navigation_menu->label());
$expected = <<<EOT
The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.
EOT;
$this->assertSame($expected, $navigation_menu->getDescription());
// Test that we can re-import using the ConfigEntityBase destination.
Database::getConnection('default', 'migrate')->update('menu_custom')
->fields([
'title' => 'Home Navigation',
])
->condition('menu_name', 'navigation')
->execute();
$migration = $this->getMigration('d6_menu');
\Drupal::database()->truncate($migration->getIdMap()
->mapTableName())
->execute();
$this->executeMigration($migration);
$navigation_menu = Menu::load('navigation');
$this->assertSame('Home Navigation', $navigation_menu->label());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.