ErrorContainer.php

Same filename in other branches
  1. 8.9.x core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php
  2. 10 core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php
  3. 11.x core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php

Namespace

Drupal\FunctionalTests\Bootstrap

File

core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php

View source
<?php

namespace Drupal\FunctionalTests\Bootstrap;

use Drupal\Core\DependencyInjection\Container;

/**
 * Container base class which triggers an error.
 */
class ErrorContainer extends Container {
    
    /**
     * {@inheritdoc}
     */
    public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
        if ($id === 'http_kernel') {
            // Enforce a recoverable error.
            $callable = function (ErrorContainer $container) {
            };
            return $callable(1);
        }
        return parent::get($id, $invalidBehavior);
    }

}

Classes

Title Deprecated Summary
ErrorContainer Container base class which triggers an error.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.