Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / FunctionalTests / Bootstrap / ErrorContainer.php
diff --git a/web/core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php b/web/core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php
new file mode 100644 (file)
index 0000000..e88cc88
--- /dev/null
@@ -0,0 +1,27 @@
+<?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) {
+      };
+      $callable(1);
+    }
+    else {
+      return parent::get($id, $invalidBehavior);
+    }
+  }
+
+}