diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-10 13:34:15 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-10 13:34:15 +0200 |
commit | 6743106d9a8c760580690aab704f908766731801 (patch) | |
tree | 36dd2333d4148cb593e9f7fb3790740605cd1f12 /tests/Unit/Http/Validation/Rules | |
parent | 6d5ada252202bfb29eba884cf9567e969d798607 (diff) |
Replaced validation with `respect/validation`
Diffstat (limited to 'tests/Unit/Http/Validation/Rules')
-rw-r--r-- | tests/Unit/Http/Validation/Rules/InTest.php | 19 | ||||
-rw-r--r-- | tests/Unit/Http/Validation/Rules/NotInTest.php | 20 |
2 files changed, 39 insertions, 0 deletions
diff --git a/tests/Unit/Http/Validation/Rules/InTest.php b/tests/Unit/Http/Validation/Rules/InTest.php new file mode 100644 index 00000000..e5688d90 --- /dev/null +++ b/tests/Unit/Http/Validation/Rules/InTest.php @@ -0,0 +1,19 @@ +<?php + +namespace Engelsystem\Test\Unit\Http\Validation\Rules; + +use Engelsystem\Http\Validation\Rules\In; +use Engelsystem\Test\Unit\TestCase; + +class InTest extends TestCase +{ + /** + * @covers \Engelsystem\Http\Validation\Rules\In::__construct + */ + public function testConstruct() + { + $rule = new In('foo,bar'); + + $this->assertEquals(['foo', 'bar'], $rule->haystack); + } +} diff --git a/tests/Unit/Http/Validation/Rules/NotInTest.php b/tests/Unit/Http/Validation/Rules/NotInTest.php new file mode 100644 index 00000000..9be12336 --- /dev/null +++ b/tests/Unit/Http/Validation/Rules/NotInTest.php @@ -0,0 +1,20 @@ +<?php + +namespace Engelsystem\Test\Unit\Http\Validation\Rules; + +use Engelsystem\Http\Validation\Rules\NotIn; +use Engelsystem\Test\Unit\TestCase; + +class NotInTest extends TestCase +{ + /** + * @covers \Engelsystem\Http\Validation\Rules\NotIn::validate + */ + public function testConstruct() + { + $rule = new NotIn('foo,bar'); + + $this->assertTrue($rule->validate('lorem')); + $this->assertFalse($rule->validate('foo')); + } +} |