Verifies that services are destructed when used.
public function testDestructionUsed() {
// 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'));
// Call the class and then terminate the kernel
$this->container
->get('bundle_test_class');
$response = new Response();
$this->container
->get('kernel')
->terminate($this->container
->get('request'), $response);
$this
->assertTrue(\Drupal::state()
->get('bundle_test.destructed'));
}