Version 1
[yaffs-website] / web / core / modules / block / tests / modules / block_test / src / Plugin / Block / TestContextAwareUnsatisfiedBlock.php
diff --git a/web/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareUnsatisfiedBlock.php b/web/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareUnsatisfiedBlock.php
new file mode 100644 (file)
index 0000000..f70e8e2
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace Drupal\block_test\Plugin\Block;
+
+use Drupal\Core\Block\BlockBase;
+
+/**
+ * Provides a context-aware block.
+ *
+ * @Block(
+ *   id = "test_context_aware_unsatisfied",
+ *   admin_label = @Translation("Test context-aware unsatisfied block"),
+ *   context = {
+ *     "user" = @ContextDefinition("entity:foobar")
+ *   }
+ * )
+ */
+class TestContextAwareUnsatisfiedBlock extends BlockBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function build() {
+    return [
+      '#markup' => 'test',
+    ];
+  }
+
+}