From 43ec8517cbc42093ad1f17063495f79e6eddf1cf Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 5 Jan 2022 17:05:10 +0100 Subject: Build pages with file fields --- tests/Test.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') 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', <<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); } } -- cgit v1.2.3