diff core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php	Thu Feb 28 13:21:36 2019 +0000
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\FunctionalTests\Bootstrap;
+
+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) {
+    if ($id === 'http_kernel') {
+      throw new \Exception('Thrown exception during Container::get');
+    }
+    else {
+      return parent::get($id, $invalidBehavior);
+    }
+  }
+
+}