ViewModeTest.php
Same filename in this branch
Same filename in other branches
- 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/ViewModeTest.php
- 9 core/modules/node/tests/src/Kernel/Plugin/migrate/source/d6/ViewModeTest.php
- 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/ViewModeTest.php
- 8.9.x core/modules/node/tests/src/Kernel/Plugin/migrate/source/d6/ViewModeTest.php
- 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/ViewModeTest.php
- 10 core/modules/node/tests/src/Kernel/Plugin/migrate/source/d6/ViewModeTest.php
Namespace
Drupal\Tests\node\Kernel\Plugin\migrate\source\d6File
-
core/
modules/ node/ tests/ src/ Kernel/ Plugin/ migrate/ source/ d6/ ViewModeTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\node\Kernel\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests D6 view mode source plugin.
*
* @covers \Drupal\node\Plugin\migrate\source\d6\ViewMode
*
* @group node
*/
class ViewModeTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'node',
'user',
'migrate_drupal',
];
/**
* {@inheritdoc}
*/
public static function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['content_node_field_instance'] = [
[
'display_settings' => serialize([
'weight' => '31',
'parent' => '',
'label' => [
'format' => 'above',
],
'teaser' => [
'format' => 'default',
'exclude' => 0,
],
'full' => [
'format' => 'default',
'exclude' => 0,
],
4 => [
'format' => 'default',
'exclude' => 0,
],
]),
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'entity_type' => 'node',
'view_mode' => '4',
],
[
'entity_type' => 'node',
'view_mode' => 'teaser',
],
[
'entity_type' => 'node',
'view_mode' => 'full',
],
];
return $tests;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
ViewModeTest | Tests D6 view mode source plugin. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.