diff --git a/tests/uts/formhandler_BrowserFieldTest.php b/tests/uts/formhandler_BrowserFieldTest.php new file mode 100644 index 0000000..4952e33 --- /dev/null +++ b/tests/uts/formhandler_BrowserFieldTest.php @@ -0,0 +1,47 @@ +browserField("BrowserField", "browserfield", "a/path"); + + $this->assertFormFlushContains($form, [ + 'BrowserField: error_browserfield' + ]); + } + + public function test_viewmode(): void + { + $form = new FormHandler(); + + $form->browserField("BrowserField", "browserfield", "a/path"); + $form->setFieldViewMode("browserfield"); + + $this->assertFormFlushContains($form, [ + 'BrowserField:error_browserfield' + ]); + } + + public function test_posted(): void + { + $_POST['FormHandler_submit'] = "1"; + $_POST['browserfield'] = "o1"; + + $form = new FormHandler(); + + $form->browserField("BrowserField", "browserfield", "a/path"); + + $this->assertEquals("o1", $form->getValue("browserfield")); + + $this->assertTrue($form->isCorrect()); + } + + +};