Commit Graph

147 Commits

Author SHA1 Message Date
Robert Korulczyk
a9f2827f87 Add tests with double dot for EmailValidator. 2017-10-06 10:05:56 +02:00
SilverFire - Dmitry Naumenko
40ae296b82 Fixed broken test 2017-09-11 12:49:46 +03:00
SilverFire - Dmitry Naumenko
f9b0090a7d Added more tests for FileValidator to make sure it works as should
Closes #14778
2017-09-09 16:13:10 +03:00
Carsten Brandt
36b535c26b Fixes #13254: Made yii\helpers\StringHelper and yii\validators\StringValidator independent of Yii::$app instance 2017-09-07 22:32:07 +03:00
Robert Korulczyk
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
Robert Korulczyk
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
Robert Korulczyk
0c0942d6e2 Enable phpdoc_add_missing_param_annotation rule in php-cs-fixer config. (#14681) [skip ci] 2017-08-21 01:57:23 +03:00
Dmitry Dorogin
8ae2223c6a Fixes #14370: Fixed creating built-in validator in model with same function name 2017-07-23 17:17:20 +03:00
Carsten Brandt
aba0b4a59a added test that fails #14413
See #13979

close #14413
2017-07-16 01:47:49 +02:00
Robert Korulczyk
d2781cd232 Added configuration for headers in PHP files generated by message/extract command (#14417) 2017-07-10 20:14:54 +03:00
Alexander Makarov
d4c15c36d0 Fixes #14304: Fixed yii\validators\UniqueValidator and yii\validators\ExistValidator to skip prefixes in case expressions are used 2017-06-27 00:02:47 +03:00
Robert Korulczyk
ba0ab403b5 Added php-cs-fixer coding standards validation to Travis CI (#14100)
* php-cs-fixer: PSR2 rule.

* php-cs-fixer: PSR2 rule - fix views.

* Travis setup refactoring.

* Add php-cs-fixer to travis cs tests.

* Fix tests on hhvm-3.12

* improve travis config

* composer update

* revert composer update

* improve travis config

* Fix CS.

* Extract config to separate classes.

* Extract config to separate classes.

* Add file header.

* Force short array syntax.

* binary_operator_spaces fixer

* Fix broken tests

* cast_spaces fixer

* concat_space fixer

* dir_constant fixer

* ereg_to_preg fixer

* function_typehint_space fixer

* hash_to_slash_comment fixer

* is_null fixer

* linebreak_after_opening_tag fixer

* lowercase_cast fixer

* magic_constant_casing fixer

* modernize_types_casting fixer

* native_function_casing fixer

* new_with_braces fixer

* no_alias_functions fixer

* no_blank_lines_after_class_opening fixer

* no_blank_lines_after_phpdoc fixer

* no_empty_comment fixer

* no_empty_phpdoc fixer

* no_empty_statement fixer

* no_extra_consecutive_blank_lines fixer

* no_leading_import_slash fixer

* no_leading_namespace_whitespace fixer

* no_mixed_echo_print fixer

* no_multiline_whitespace_around_double_arrow fixer

* no_multiline_whitespace_before_semicolons fixer

* no_php4_constructor fixer

* no_short_bool_cast fixer

* no_singleline_whitespace_before_semicolons fixer

* no_spaces_around_offset fixer

* no_trailing_comma_in_list_call fixer

* no_trailing_comma_in_singleline_array fixer

* no_unneeded_control_parentheses fixer

* no_unused_imports fixer

* no_useless_return fixer

* no_whitespace_before_comma_in_array fixer

* no_whitespace_in_blank_line fixer

* not_operator_with_successor_space fixer

* object_operator_without_whitespace fixer

* ordered_imports fixer

* php_unit_construct fixer

* php_unit_dedicate_assert fixer

* php_unit_fqcn_annotation fixer

* phpdoc_indent fixer

* phpdoc_no_access fixer

* phpdoc_no_empty_return fixer

* phpdoc_no_package fixer

* phpdoc_no_useless_inheritdoc fixer

* Fix broken tests

* phpdoc_return_self_reference fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_to_comment fixer

* phpdoc_trim fixer

* phpdoc_var_without_name fixer

* psr4 fixer

* self_accessor fixer

* short_scalar_cast fixer

* single_blank_line_before_namespace fixer

* single_quote fixer

* standardize_not_equals fixer

* ternary_operator_spaces fixer

* trailing_comma_in_multiline_array fixer

* trim_array_spaces fixer

* protected_to_private fixer

* unary_operator_spaces fixer

* whitespace_after_comma_in_array fixer

* `parent::setRules()` -> `$this->setRules()`

* blank_line_after_opening_tag fixer

* Update finder config.

* Revert changes for YiiRequirementChecker.

* Fix array formatting.

* Add missing import.

* Fix CS for new code merged from master.

* Fix some indentation issues.
2017-06-12 12:25:45 +03:00
Paul Klimov
40e5702b6b Fixes #5108 DateValidator resets $timestampAttribute value on empty attribute (#14242)
* `yii\validators\DateValidator` now resets `$timestampAttribute` value on empty validated attribute value

* array-value test at `DateValidatorTest` restored
2017-06-05 11:50:02 +02:00
Alexander Makarov
b151b1cdb2 Fixes #14150 2017-05-12 14:17:23 +03:00
Alexander Makarov
d331b72be6 Merge branch 'master' into unique-validator-fix 2017-05-12 00:45:55 +03:00
Carsten Brandt
5c72047426 Fixed ambiguous column name in SELECT in UniqueValidator
fixes #14042
2017-05-10 12:02:48 +03:00
Alexander Makarov
23cc4bf4fe Further changes for unique and exist validators
- Combined methods for getting names and aliases of from tables
- Normalized names and aliases
- Added MSSQL syntax
- Added support for spaces in aliases and table names
2017-05-10 00:35:40 +03:00
Robert Korulczyk
31e321b9b2 Remove unused imports. (#14096) 2017-05-01 20:26:15 +02:00
Carsten Brandt
d786b78f25 Helper independent (#14050)
* Made sure most helpers are independent of Yii::$app

* Made sure most validators are independent of Yii::$app
2017-04-26 09:49:44 +02:00
Paul Klimov
3598f8180c Fixes #13087: Fixed getting active validators for safe attribute 2017-04-26 02:29:10 +03:00
Mikk Tendermann
59d3292399 [IpValidator] disable ipv6 checks (#13984)
* disable ipv6 checks

* remove empty line

* updated CHANGELOG.md
2017-04-18 19:06:31 +03:00
Klimov Paul
dee88787fc compatibility with PHPUnit 6.x added 2017-04-13 14:49:43 +03:00
vladis84
3c1f3e20cf Fixes #13704: Fixed yii\validators\UniqueValidator to prefix attribute name with model's database table name 2017-03-16 17:42:31 +03:00
Alexander Makarov
3f8e8a89eb Used more specific unit test assertions in framework tests 2017-03-14 09:45:31 +03:00
gagatust
6397791513 Fixed whitespaces to match code style [skip ci] 2017-03-14 09:42:13 +03:00
Kolyunya
f9041646dd Improve string validator test coverage 2017-03-05 14:27:13 +03:00
Elvira Sheina
2de18cf9a5 Fixes #13087: Fixed getting active validators for safe attribute 2017-02-22 17:06:19 +03:00
SilverFire - Dmitry Naumenko
b4c7aaa5e0 Added more examples to EmailValidatorTest
Closes #9201
Closes #9067
2017-02-21 23:58:34 +02:00
Carsten Brandt
fba4e43469 added failing test for #13533
issue #13533
PR #13534
2017-02-08 09:10:19 +01:00
Elvira Sheina
d39c491022 Fix BC breaking #13475 (#13478) 2017-01-31 11:56:46 +03:00
Elvira Sheina
b82caa97e8 Fixes #7820: Add or relation for targetAttribute in yii\validators\UniqueValidator 2017-01-22 19:45:18 +03:00
Alexander Makarov
eee7b9663c Merge branch 'master' into fix-numbervalidator-comma-decimal-separator 2017-01-15 22:41:09 +03:00
Klimov Paul
d4ac47abe7 Added yii\validators\EachValidator::$stopOnFirstError allowing addition of more than one error 2017-01-13 17:59:10 +02:00
Carsten Brandt
96ee5c373e added more tests for SwiftMailer vulnerability CVE-2016-10074
https://legalhackers.com/advisories/SwiftMailer-Exploit-Remote-Code-Exec-CVE-2016-10074-Vuln.html
2016-12-28 23:50:10 +01:00
SilverFire - Dmitry Naumenko
6af2a43390 Added EmailValidatorTest to prove CVE-2016-10074 does not affect EmailValidator 2016-12-29 00:21:23 +02:00
Klimov Paul
194577c55e Code style fix 2016-12-26 15:39:33 +02:00
Alexander Makarov
a7f0a3c147 Merge branch 'master' into fix-numbervalidator-comma-decimal-separator 2016-12-17 16:39:00 +03:00
Robert Korulczyk
08054bba6d Fix tests. (#13227) 2016-12-17 16:37:31 +03:00
Elvira Sheina
bfba0aa711 Refactor validateAttribute method in UniqueValidator (#13202)
* Refactor validateAttribute method in UniqueValidator

Extract prepareParams and prepareQuery from validateAttribute,
so they can be tested separately.

* Added issue number to changelog

* Eliminated unneeded variable

* Renamed methods and parameters, update PHPDocs
2016-12-15 12:23:16 +01:00
SilverFire - Dmitry Naumenko
a132ee9a08 Fixed order or checks in IpValidator
Fixes #13198
2016-12-13 18:14:04 +02:00
Alexey Rogachev
bd85b7ced2 Closes #6242: Access to validator in inline validation (#13027)
* Closes #6242: Access to validator in inline validation

* Updated PHPDoc according to PR review [skip ci]

* Imrpoved PHPDoc, updated guide info [skip ci]

* Fixes related with PR review

* Corrected CHANGELOG [skip ci]

* Update input-validation.md

added version info
2016-12-08 23:29:53 +01:00
Alexander Makarov
a056281fa0 Attempt to make tests pass on travis environment 2016-12-04 00:58:40 +03:00
Alexander Makarov
b17dfa03a2 Fixes #10488: Fixed incorrect behavior of yii\validation\NumberValidator when used with locales where decimal separator is comma 2016-12-02 00:04:55 +03:00
Vladimir Khramov
dd94ead358 Initial work on #10488 2016-12-02 00:01:51 +03:00
yamaha252
22b2a78a0a Added test for unique validator with empty values
close #7007
2016-11-27 02:37:12 +01:00
SilverFire - Dmitry Naumenko
25ebf03a8d Fixed ValidatorTest::testValidateWithEmpty()
Closes #12848
2016-11-12 16:20:41 +02:00
Robert Korulczyk
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
Robert Korulczyk
4fdfbc2739 Add tests for custom message for UniqueValidator 2016-08-24 22:59:58 +02:00
Carsten Brandt
d2dd232b6f message improvement and test for #11323 2016-07-06 14:27:50 +02:00
Sam Mousa
b30b5a99ea Fixes #11672: Fixed yii\validators\NumberValidator erroring when value is an object without __toString() method 2016-06-23 23:32:25 +03:00