Loading core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php +20 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,26 @@ public function testUninstallEntityTypeWithoutInCodeDefinition() { $this->deleteEntityType(); // Now uninstall it and check that the tables have been removed. $this->assertTrue($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update exists before uninstalling it.'); $this->entityDefinitionUpdateManager->uninstallEntityType($entity_type); $this->assertFalse($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update does not exist anymore.'); } /** * Tests uninstalling a revisionable entity type that doesn't exist in code. * * @covers ::uninstallEntityType */ public function testUninstallRevisionableEntityTypeWithoutInCodeDefinition() { $this->updateEntityTypeToRevisionable(TRUE); $entity_type = $this->entityDefinitionUpdateManager->getEntityType('entity_test_update'); // Remove the entity type definition. This is the same thing as removing the // code that defines it. $this->deleteEntityType(); // Now uninstall it and check that the tables have been removed. $this->assertTrue($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update exists before uninstalling it.'); $this->entityDefinitionUpdateManager->uninstallEntityType($entity_type); $this->assertFalse($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update does not exist anymore.'); } Loading Loading
core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php +20 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,26 @@ public function testUninstallEntityTypeWithoutInCodeDefinition() { $this->deleteEntityType(); // Now uninstall it and check that the tables have been removed. $this->assertTrue($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update exists before uninstalling it.'); $this->entityDefinitionUpdateManager->uninstallEntityType($entity_type); $this->assertFalse($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update does not exist anymore.'); } /** * Tests uninstalling a revisionable entity type that doesn't exist in code. * * @covers ::uninstallEntityType */ public function testUninstallRevisionableEntityTypeWithoutInCodeDefinition() { $this->updateEntityTypeToRevisionable(TRUE); $entity_type = $this->entityDefinitionUpdateManager->getEntityType('entity_test_update'); // Remove the entity type definition. This is the same thing as removing the // code that defines it. $this->deleteEntityType(); // Now uninstall it and check that the tables have been removed. $this->assertTrue($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update exists before uninstalling it.'); $this->entityDefinitionUpdateManager->uninstallEntityType($entity_type); $this->assertFalse($this->database->schema()->tableExists('entity_test_update'), 'Base table for entity_test_update does not exist anymore.'); } Loading