Verifies that services are not unnecessarily destructed when not used.
public function testDestructionUnused() {
// Enable the test module to add it to the container.
$this
->enableModules(array(
'bundle_test',
));
// The service has not been destructed yet.
$this
->assertNull(\Drupal::state()
->get('bundle_test.destructed'));
// Terminate the kernel. The test class has not been called, so it should not
// be destructed.
$response = new Response();
$this->container
->get('kernel')
->terminate($this->container
->get('request'), $response);
$this
->assertNull(\Drupal::state()
->get('bundle_test.destructed'));
}