function MigrateNodeTypeTest::testNodeType
Same name in this branch
- 10 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTypeTest::testNodeType()
Same name in other branches
- 9 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTypeTest::testNodeType()
- 9 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeTypeTest::testNodeType()
- 8.9.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTypeTest::testNodeType()
- 8.9.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeTypeTest::testNodeType()
- 11.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTypeTest::testNodeType()
- 11.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeTypeTest::testNodeType()
Tests Drupal 7 node type to Drupal 8 migration.
File
-
core/
modules/ node/ tests/ src/ Kernel/ Migrate/ d7/ MigrateNodeTypeTest.php, line 83
Class
- MigrateNodeTypeTest
- Upgrade node types to node.type.*.yml.
Namespace
Drupal\Tests\node\Kernel\Migrate\d7Code
public function testNodeType() : void {
$expected_available_menus = [
'main',
];
$expected_parent = 'main:';
$this->assertEntity('article', 'Article', 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.', 'Help text for articles', TRUE, FALSE, $expected_available_menus, $expected_parent, "Body");
$this->assertEntity('blog', 'Blog entry', 'Use for multi-user blogs. Every user gets a personal blog.', 'Blog away, good sir!', TRUE, FALSE, $expected_available_menus, $expected_parent, 'Body');
// book's display_submitted flag is not set, so it will default to TRUE.
$this->assertEntity('book', 'Book page', '<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.', '', TRUE, TRUE, $expected_available_menus, $expected_parent, "Body");
$this->assertEntity('forum', 'Forum topic', 'A <em>forum topic</em> starts a new discussion thread within a forum.', 'No name-calling, no flame wars. Be nice.', TRUE, FALSE, $expected_available_menus, $expected_parent, 'Body');
$this->assertEntity('page', 'Basic page', "Use <em>basic pages</em> for your static content, such as an 'About us' page.", 'Help text for basic pages', FALSE, FALSE, $expected_available_menus, $expected_parent, "Body");
// Test the 32 character type name exists.
$this->assertEntity('a_thirty_two_character_type_name', 'Test long name', '', '', TRUE, FALSE, NULL, NULL, "Body");
// This node type does not carry a body field.
$expected_available_menus = [
'main',
'admin',
'tools',
'account',
];
$this->assertEntity('test_content_type', 'Test content type', 'This is the description of the test content type.', 'Help text for test content type', FALSE, TRUE, $expected_available_menus, $expected_parent);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.