Version 1
[yaffs-website] / web / core / modules / system / tests / modules / error_service_test / src / Controller / LonelyMonkeyController.php
diff --git a/web/core/modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php b/web/core/modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php
new file mode 100644 (file)
index 0000000..4946417
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+namespace Drupal\error_service_test\Controller;
+
+use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
+use Drupal\error_service_test\LonelyMonkeyClass;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Provides a controller which calls out to a service with missing dependencies.
+ */
+class LonelyMonkeyController extends ControllerBase implements ContainerInjectionInterface {
+
+  public function __construct(LonelyMonkeyClass $class) {
+    $this->class = $class;
+  }
+
+  public function testBrokenClass() {
+    return [
+      '#markup' => $this->t('This should be broken.'),
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static($container->get('broken_class_with_missing_dependency'));
+  }
+
+}