Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / tests / src / Kernel / Form / FormObjectTest.php
diff --git a/web/core/modules/system/tests/src/Kernel/Form/FormObjectTest.php b/web/core/modules/system/tests/src/Kernel/Form/FormObjectTest.php
new file mode 100644 (file)
index 0000000..36cbb50
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+
+namespace Drupal\Tests\system\Kernel\Form;
+
+use Drupal\form_test\FormTestObject;
+use Drupal\KernelTests\ConfigFormTestBase;
+
+/**
+ * Tests building a form from an object.
+ *
+ * @group Form
+ */
+class FormObjectTest extends ConfigFormTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['form_test'];
+
+  protected function setUp() {
+    parent::setUp();
+
+    $this->form = new FormTestObject($this->container->get('config.factory'));
+    $this->values = [
+      'bananas' => [
+        '#value' => $this->randomString(10),
+        '#config_name' => 'form_test.object',
+        '#config_key' => 'bananas',
+      ],
+    ];
+  }
+
+}