diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php index 6cfc32f..67ff882 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php @@ -32,7 +32,7 @@ public static function getInfo() { * * Load available node types and validate the returned data. */ - function testNodeTypeGetFunctions() { + public function testNodeTypeGetFunctions() { $node_types = node_type_get_types(); $node_names = node_type_get_names(); @@ -49,7 +49,7 @@ function testNodeTypeGetFunctions() { /** * Tests creating a content type programmatically and via a form. */ - function testNodeTypeCreation() { + public function testNodeTypeCreation() { // Create a content type programmaticaly. $type = $this->drupalCreateContentType(); @@ -67,19 +67,23 @@ function testNodeTypeCreation() { $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types')); $this->drupalLogin($web_user); $edit = array( - 'name' => 'foo', - 'title_label' => 'title for foo', - 'type' => 'foo', + 'name' => 'node_type_test', + 'title_label' => 'title for node_type_test', + 'type' => 'node_type_test', ); $this->drupalPostForm('admin/structure/types/add', $edit, t('Save and manage fields')); - $type_exists = (bool) entity_load('node_type', 'foo'); + + // Verify that the node_type node_type_test has the correct uuid. + $entity = entity_load('node_type', 'node_type_test'); + $this->assertEqual($entity->uuid(), '95608930-932d-11e3-baa8-0800200c9a66', 'Correct uuid for the node_type_test module.'); + $type_exists = (bool) entity_load('node_type', 'node_type_test'); $this->assertTrue($type_exists, 'The new content type has been created in the database.'); } /** * Tests editing a node type using the UI. */ - function testNodeTypeEditing() { + public function testNodeTypeEditing() { $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'administer node fields')); $this->drupalLogin($web_user); @@ -132,7 +136,7 @@ function testNodeTypeEditing() { /** * Tests that node types correctly handles their locking. */ - function testNodeTypeStatus() { + public function testNodeTypeStatus() { // Enable all core node modules, and all types should be active. $this->container->get('module_handler')->install(array('book'), FALSE); $types = node_type_get_types(); @@ -161,7 +165,7 @@ function testNodeTypeStatus() { /** * Tests deleting a content type that still has content. */ - function testNodeTypeDeletion() { + public function testNodeTypeDeletion() { // Create a content type programmatically. $type = $this->drupalCreateContentType(); diff --git a/core/modules/node/tests/modules/node_type_test/config/node.type.node_type_test.yml b/core/modules/node/tests/modules/node_type_test/config/node.type.node_type_test.yml new file mode 100644 index 0000000..6377128 --- /dev/null +++ b/core/modules/node/tests/modules/node_type_test/config/node.type.node_type_test.yml @@ -0,0 +1,19 @@ +type: node_type_test +uuid: 95608930-932d-11e3-baa8-0800200c9a66 +name: 'Node Type Test' +description: 'Node Type Test.' +help: '' +has_title: true +title_label: Title +settings: + node: + preview: 1 + options: + status: true + # Not promoted to front page. + promote: false + sticky: false + revision: false + submitted: true +status: true +langcode: en diff --git a/core/modules/node/tests/modules/node_type_test/node_type_test.info.yml b/core/modules/node/tests/modules/node_type_test/node_type_test.info.yml new file mode 100644 index 0000000..6d4f280 --- /dev/null +++ b/core/modules/node/tests/modules/node_type_test/node_type_test.info.yml @@ -0,0 +1,7 @@ +name: 'Node module tests' +type: module +description: 'Support module for node type related testing.' +package: Testing +version: VERSION +core: 8.x +hidden: true diff --git a/core/modules/node/tests/modules/node_type_test/node_type_test.module b/core/modules/node/tests/modules/node_type_test/node_type_test.module new file mode 100644 index 0000000..7556f27 --- /dev/null +++ b/core/modules/node/tests/modules/node_type_test/node_type_test.module @@ -0,0 +1,7 @@ +