Version 1
[yaffs-website] / web / core / modules / system / tests / modules / plugin_test / src / Plugin / plugin_test / mock_block / MockUserLoginBlock.php
diff --git a/web/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php b/web/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php
new file mode 100644 (file)
index 0000000..6741eac
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
+
+use Drupal\Component\Plugin\PluginBase;
+
+/**
+ * Mock implementation of a login block plugin used by Plugin API unit tests.
+ *
+ * @see \Drupal\plugin_test\Plugin\MockBlockManager
+ */
+class MockUserLoginBlock extends PluginBase {
+
+  /**
+   * The title to display when rendering this block instance.
+   *
+   * @var string
+   */
+  protected $title;
+
+  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->title = isset($configuration['title']) ? $configuration['title'] : '';
+  }
+
+  public function getTitle() {
+    return $this->title;
+  }
+
+}