From a2a9c8c3cad902da62577d61ceb1a23d77f2be70 Mon Sep 17 00:00:00 2001 From: drobek94 <90322331+drobek94@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:17:38 +0100 Subject: [PATCH] Validator: added support for enums (#282) Co-authored-by: martin.sedlacek --- tests/Forms/Controls.BaseControl.enum.phpt | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/Forms/Controls.BaseControl.enum.phpt diff --git a/tests/Forms/Controls.BaseControl.enum.phpt b/tests/Forms/Controls.BaseControl.enum.phpt new file mode 100644 index 000000000..bee011224 --- /dev/null +++ b/tests/Forms/Controls.BaseControl.enum.phpt @@ -0,0 +1,39 @@ +addText('text'); + $input->setValue(TestEnum::CASE_1->value); + + Assert::true(Validator::validateEqual($input, TestEnum::CASE_1)); + Assert::true(Validator::validateEqual($input, 'case 1')); + Assert::false(Validator::validateEqual($input, TestEnum::CASE_2)); + Assert::false(Validator::validateEqual($input, 1)); +});