ExceptionContainer.php 498 Bytes
Newer Older
1 2
<?php

3
namespace Drupal\FunctionalTests\Bootstrap;
4 5 6 7 8 9 10 11 12 13 14 15

use Drupal\Core\DependencyInjection\Container;

/**
 * Base container which throws an exception.
 */
class ExceptionContainer extends Container {

  /**
   * {@inheritdoc}
   */
  public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
16 17 18 19 20 21
    if ($id === 'http_kernel') {
      throw new \Exception('Thrown exception during Container::get');
    }
    else {
      return parent::get($id, $invalidBehavior);
    }
22 23 24
  }

}