MigrateViewModesTest.php
Same filename in this branch
Same filename in other branches
- 9 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
- 9 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php
- 10 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
- 10 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php
- 11.x core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
- 11.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php
Namespace
Drupal\Tests\node\Kernel\Migrate\d6File
-
core/
modules/ node/ tests/ src/ Kernel/ Migrate/ d6/ MigrateViewModesTest.php
View source
<?php
namespace Drupal\Tests\node\Kernel\Migrate\d6;
use Drupal\Core\Entity\Entity\EntityViewMode;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Migrate view modes.
*
* @group migrate_drupal_6
*/
class MigrateViewModesTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d6_view_modes');
}
/**
* Tests Drupal 6 view modes to Drupal 8 migration.
*/
public function testViewModes() {
// Test a new view mode.
$view_mode = EntityViewMode::load('node.preview');
$this->assertNotNull($view_mode);
$this->assertIdentical('Preview', $view_mode->label(), 'View mode has correct label.');
// Test the ID map.
$this->assertIdentical([
[
'node',
'preview',
],
], $this->getMigration('d6_view_modes')
->getIdMap()
->lookupDestinationIds([
1,
]));
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
MigrateViewModesTest | Migrate view modes. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.