Version 1
[yaffs-website] / web / core / modules / system / tests / modules / condition_test / src / Plugin / Condition / ConditionTestNoExistingType.php
diff --git a/web/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestNoExistingType.php b/web/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestNoExistingType.php
new file mode 100644 (file)
index 0000000..ef00053
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\condition_test\Plugin\Condition;
+
+use Drupal\Core\Condition\ConditionPluginBase;
+
+/**
+ * Provides a condition that has a no existing context.
+ *
+ * @Condition(
+ *   id = "condition_test_no_existing_type",
+ *   label = @Translation("No existing type"),
+ *   context = {
+ *     "no_existing_type" = @ContextDefinition("no_existing_type", label = @Translation("No existing type")),
+ *   }
+ * )
+ */
+class ConditionTestNoExistingType extends ConditionPluginBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function evaluate() {
+    return TRUE;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function summary() {
+    return $this->t('Condition that requires a non-existent context.');
+  }
+
+}