Chris@0: drupalLogin($this->webUser); Chris@0: $comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName()); Chris@0: $this->assertTrue($comment->id(), 'The comment could be loaded.'); Chris@0: $this->node->delete(); Chris@0: $this->assertFalse(Comment::load($comment->id()), 'The comment could not be loaded after the node was deleted.'); Chris@0: // Make sure the comment field storage and all its fields are deleted when Chris@0: // the node type is deleted. Chris@0: $this->assertNotNull(FieldStorageConfig::load('node.comment'), 'Comment field storage exists'); Chris@0: $this->assertNotNull(FieldConfig::load('node.article.comment'), 'Comment field exists'); Chris@0: // Delete the node type. Chris@0: entity_delete_multiple('node_type', [$this->node->bundle()]); Chris@0: $this->assertNull(FieldStorageConfig::load('node.comment'), 'Comment field storage deleted'); Chris@0: $this->assertNull(FieldConfig::load('node.article.comment'), 'Comment field deleted'); Chris@0: } Chris@0: Chris@0: }