b33d263495aa07381e5a287b1d94d768ee326492
[yaffs-website] / web / core / tests / Drupal / FunctionalTests / Bootstrap / ExceptionContainer.php
1 <?php
2
3 namespace Drupal\FunctionalTests\Bootstrap;
4
5 use Drupal\Core\DependencyInjection\Container;
6
7 /**
8  * Base container which throws an exception.
9  */
10 class ExceptionContainer extends Container {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
16     if ($id === 'http_kernel') {
17       throw new \Exception('Thrown exception during Container::get');
18     }
19     else {
20       return parent::get($id, $invalidBehavior);
21     }
22   }
23
24 }