diff core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.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/ErrorContainer.php	Thu Feb 28 13:21:36 2019 +0000
@@ -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);
+    }
+  }
+
+}