Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / workflows / tests / src / Kernel / PredefinedWorkflowTypeTest.php
diff --git a/web/core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php b/web/core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php
new file mode 100644 (file)
index 0000000..f3f0b57
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+
+namespace Drupal\Tests\workflows\Kernel;
+
+use Drupal\KernelTests\KernelTestBase;
+use Drupal\workflows\Entity\Workflow;
+
+/**
+ * Test a predefined workflow based on something other than configuration.
+ *
+ * @group workflows
+ */
+class PredefinedWorkflowTypeTest extends KernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['workflows', 'workflow_type_test'];
+
+  /**
+   * Test a predefined workflow type.
+   */
+  public function testPredefinedWorkflowType() {
+    $workflow = Workflow::create([
+      'id' => 'aces',
+      'label' => 'Aces Workflow',
+      'type' => 'predefined_states_workflow_test_type',
+      'transitions' => [
+        'bet' => [
+          'label' => 'Bet',
+          'from' => [
+            'pay_blinds',
+          ],
+          'to' => 'bet',
+        ],
+        'raise' => [
+          'label' => 'Raise',
+          'from' => [
+            'pay_blinds',
+          ],
+          'to' => 'raise',
+        ],
+      ],
+    ]);
+    $workflow->save();
+
+    // No states configuration is stored for this workflow.
+    $configuration = $workflow->getTypePlugin()->getConfiguration();
+    $this->assertFalse(isset($configuration['states']));
+  }
+
+}