diff --git a/core/modules/book/src/Tests/BookUninstallTest.php b/core/modules/book/src/Tests/BookUninstallTest.php index 38b4301..8a7a0c8 100644 --- a/core/modules/book/src/Tests/BookUninstallTest.php +++ b/core/modules/book/src/Tests/BookUninstallTest.php @@ -8,6 +8,7 @@ namespace Drupal\book\Tests; use Drupal\node\Entity\Node; +use Drupal\node\Entity\NodeType; use Drupal\simpletest\KernelTestBase; /** @@ -33,7 +34,9 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installSchema('book', array('book')); $this->installSchema('node', array('node_access')); - $this->installConfig(array('field', 'node', 'book')); + $this->installConfig(array('node', 'book', 'field')); + // For uninstall to work. + $this->installSchema('user', array('users_data')); } /** @@ -91,6 +94,10 @@ public function testBookUninstall() { // not required. $module_data = _system_rebuild_module_data(); $this->assertFalse(isset($module_data['book']->info['required']), 'The book module is not required.'); + + // Uninstall the Book module and check the node type is deleted. + \Drupal::moduleHandler()->uninstall(['book']); + $this->assertNull(NodeType::load('book'), "The book node type does not exist."); } }