diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-09 21:43:18 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-09 21:43:18 +0200 |
commit | 7414f9b23dbcc66e5f0efda3d0cbfd79372ec780 (patch) | |
tree | 891a11b71d8b25922fc4b343dbc77a01a0646ba1 /tests/Unit/Http/Validation/Stub/ValidatesRequestImplementation.php | |
parent | 508695efb253d7bc0caea1fa017ed5608d774596 (diff) |
Implemented Validation for controllers
Diffstat (limited to 'tests/Unit/Http/Validation/Stub/ValidatesRequestImplementation.php')
-rw-r--r-- | tests/Unit/Http/Validation/Stub/ValidatesRequestImplementation.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/Unit/Http/Validation/Stub/ValidatesRequestImplementation.php b/tests/Unit/Http/Validation/Stub/ValidatesRequestImplementation.php new file mode 100644 index 00000000..772b1dc9 --- /dev/null +++ b/tests/Unit/Http/Validation/Stub/ValidatesRequestImplementation.php @@ -0,0 +1,27 @@ +<?php + +namespace Engelsystem\Test\Unit\Http\Validation\Stub; + +use Engelsystem\Controllers\BaseController; +use Engelsystem\Http\Request; + +class ValidatesRequestImplementation extends BaseController +{ + /** + * @param Request $request + * @param array $rules + * @return array + */ + public function validateData(Request $request, array $rules) + { + return $this->validate($request, $rules); + } + + /** + * @return bool + */ + public function hasValidator() + { + return !is_null($this->validator); + } +} |