Ensures Twig engine debug setting can be overridden.
function testTwigDebugOverride() {
  // Enable debug and rebuild the service container.
  $this
    ->settingsSet('twig_debug', TRUE);
  $this
    ->rebuildContainer();
  // Check isDebug() via the Twig service container.
  $this
    ->assertTrue(drupal_container()
    ->get('twig')
    ->isDebug(), 'Twig debug enabled.');
  $this
    ->assertTrue(drupal_container()
    ->get('twig')
    ->isAutoReload(), 'Twig automatic reloading is enabled when debug is enabled.');
  // Override auto reload when debug is enabled.
  $this
    ->settingsSet('twig_auto_reload', FALSE);
  $this
    ->rebuildContainer();
  $this
    ->assertFalse(drupal_container()
    ->get('twig')
    ->isAutoReload(), 'Twig automatic reloading can be disabled when debug is enabled.');
  // Disable debug and check the service container again.
  $this
    ->settingsSet('twig_debug', FALSE);
  $this
    ->rebuildContainer();
  $this
    ->assertFalse(drupal_container()
    ->get('twig')
    ->isDebug(), 'Twig debug disabled.');
}