diff options
author | Daniel Weipert <code@drogueronin.de> | 2022-01-05 17:05:10 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2022-01-10 11:29:13 +0100 |
commit | 43ec8517cbc42093ad1f17063495f79e6eddf1cf (patch) | |
tree | 63394e9d41c1f3a5b1dfd85c02a30bb2241f3844 /tests | |
parent | 47e6d88484eba2733551de9edde8c4ac58706e5e (diff) |
Build pages with file fields
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Test.php | 12 |
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); } } |