diff options
author | msquare <msquare@notrademark.de> | 2019-10-13 13:43:08 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2019-10-13 13:43:08 +0200 |
commit | c0e97bfe753013b115345b00cbfd9858799a6ac9 (patch) | |
tree | 7e98447e4c7d874ec27e26801771086843f3efc3 /tests/Unit/Http/Validation/Rules/StringInputLengthTest.php | |
parent | 285f5509dd948c2359c861eec364a677e8ce4910 (diff) | |
parent | 7a2427e70296ef652f76fe2e2edc47d2e0f70f5a (diff) |
Password recovery rebuild, correctly translated Mails and some minor fixes #658
Diffstat (limited to 'tests/Unit/Http/Validation/Rules/StringInputLengthTest.php')
-rw-r--r-- | tests/Unit/Http/Validation/Rules/StringInputLengthTest.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/Unit/Http/Validation/Rules/StringInputLengthTest.php b/tests/Unit/Http/Validation/Rules/StringInputLengthTest.php new file mode 100644 index 00000000..5c4dc512 --- /dev/null +++ b/tests/Unit/Http/Validation/Rules/StringInputLengthTest.php @@ -0,0 +1,37 @@ +<?php + +namespace Engelsystem\Test\Unit\Http\Validation\Rules; + +use Engelsystem\Test\Unit\Http\Validation\Rules\Stub\UsesStringInputLength; +use Engelsystem\Test\Unit\TestCase; + +class StringInputLengthTest extends TestCase +{ + /** + * @covers \Engelsystem\Http\Validation\Rules\StringInputLength::validate + * @covers \Engelsystem\Http\Validation\Rules\StringInputLength::isDateTime + * @dataProvider validateProvider + * @param mixed $input + * @param mixed $expectedInput + */ + public function testValidate($input, $expectedInput) + { + $rule = new UsesStringInputLength(); + $rule->validate($input); + + $this->assertEquals($expectedInput, $rule->lastInput); + } + + /** + * @return array[] + */ + public function validateProvider() + { + return [ + ['TEST', 4], + ['?', 1], + ['2042-01-01 00:00', '2042-01-01 00:00'], + ['3', '3'], + ]; + } +} |