summaryrefslogtreecommitdiff
path: root/tests/Test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Test.php')
-rw-r--r--tests/Test.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/Test.php b/tests/Test.php
index 2c81d46..798a74d 100644
--- a/tests/Test.php
+++ b/tests/Test.php
@@ -36,6 +36,9 @@ class Test extends TestCase
[api]
keys = ["1234"]
+
+ [api.cors]
+ origins = []
EOF);
# formname config
@@ -84,9 +87,16 @@ class Test extends TestCase
file = "email.toml"
required = true
+ [page.second]
+ file = "second.toml"
+
[page.second.field.date]
required = true
EOF);
+ file_put_contents($contentRoot . '/customername/pagedform/fields/second.toml', <<<EOF
+ [field.text]
+ placeholder = "Text placeholder"
+ EOF);
file_put_contents($contentRoot . '/customername/pagedform/fields/email.toml', <<<EOF
type = "email"
name = "email"
@@ -162,6 +172,7 @@ class Test extends TestCase
$this->assertArrayHasKey('name', $pagedformBody['one']);
$this->assertArrayHasKey('email', $pagedformBody['one']);
$this->assertArrayHasKey('date', $pagedformBody['second']);
+ $this->assertArrayHasKey('text', $pagedformBody['second']);
// page=one
$pagedformResponse = $this->request('GET', 'customername/pagedform/fields?page=one&key=' . $this->apiKey);
@@ -175,6 +186,7 @@ class Test extends TestCase
$pagedformBody = json_decode((string)$pagedformResponse->getBody(), true)['data'];
$this->assertArrayNotHasKey('second', $pagedformBody);
$this->assertArrayHasKey('date', $pagedformBody);
+ $this->assertArrayHasKey('text', $pagedformBody);
}
}