Commit graph

69 commits

Author SHA1 Message Date
Graham Weldon
66d856d883 Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Graham Weldon
7b860debe4 This commit is dedicated to Mark Story, who has put in much dedicated time and effort into CakePHP over the years.
I just wanted to ruin his evening, because this change needs to be merged into CakePHP 3.0.
2013-02-08 20:59:49 +09:00
Ceeram
16be9d4990 remove unused local vars 2013-01-23 17:22:06 +01:00
euromark
11a88042bd fix doc block endings 2013-01-11 15:06:54 +01:00
euromark
b811afbc44 double spaces to single ones 2012-12-22 23:48:15 +01:00
Thomas Ploch
7f0085cd4e Added type hinting to Model::validator()
Added missing param and fixed typo in method's phpdoc.

Used 'assertSame' and 'assertNotSame'. Removed piped NULL type from phpdoc.

Simplify condition in Model::validator()
2012-11-28 21:32:00 -05:00
mark_story
ffcf71c810 Merge branch 'master' into 2.3 2012-11-28 21:30:15 -05:00
mark_story
f250592fee Fix multi-model validators with deep & atomic.
Apply patch from 'Christian Buffin' to fix validateMany() and
validateAssociated() when atomic=false & deep=true are used in
conjunction. Using Hash to flatten the nested set of validation results
yields the correct results.

Fixes #3352
2012-11-28 21:26:40 -05:00
mark_story
728300786b Merge branch 'master' into 2.3 2012-08-30 19:43:11 +01:00
Jose Lorenzo Rodriguez
f6278488af Ensuring list of behavior methods are refreshed between calls of
validates() in the model, fixes #3071
2012-08-25 14:05:19 +02:00
mark_story
7979ee5fa0 Remove test that is no longer needed for validation. 2012-07-17 23:18:25 -04:00
mark_story
eb7b66b37c Revert default value of allowEmpty.
In 2.1, the default value was null, which does not impart any behavior.
In 2.2 this was changed to false, which makes it hard to validate ''
with validation methods.  Move some tests around and update tests that
probably should have been failing before.

Fixes #2983
2012-06-24 20:06:14 -04:00
Ceeram
60c611fa47 Parse rules in getField() 2012-06-20 14:54:32 +02:00
Ceeram
0df1e90eed show all validation errors when saving/validating Associated and primary model fails validation as well, fixes #2925 2012-06-18 14:20:53 +02:00
Kyle Robinson Young
54745aada9 Fix custom validation methods with CakeValidationSet 2012-06-11 23:28:45 -07:00
Jose Lorenzo Rodriguez
5ba5f906e6 Adding new test case for ModelValidator 2012-06-09 15:27:22 -04:30
Jose Lorenzo Rodriguez
51635c2ca6 Merge remote-tracking branch 'origin/2.1' into 2.2
Conflicts:
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Model/ModelValidationTest.php
2012-06-06 11:06:06 -04:30
Jose Lorenzo Rodriguez
111a23274e Fixing yet another issue related to beforeValidate and
validateAssociated
2012-06-06 10:07:01 -04:30
Tigran Gabrielyan
1367e5b927 Fixed failing test case 2012-05-30 15:26:59 -07:00
Jose Lorenzo Rodriguez
9cceb1553f Improving ModelValidator::add() to allow multiple rules to be defined at once 2012-05-20 18:51:00 -04:30
mark_story
16a1a0ee79 Fix coding standards. 2012-05-20 15:51:09 -04:00
Jose Lorenzo Rodriguez
dc8c731ccb Fixed failing test case 2012-05-19 19:59:32 -04:30
Jose Lorenzo Rodriguez
b22c50d8b6 Merge branch '2.1' into 2.2-validator
Conflicts:
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Model/ModelValidationTest.php
	lib/Cake/Test/Case/Model/models.php
2012-05-19 15:39:44 -04:30
Ceeram
7dbd6bc3a2 make sure model data is moved to alias, even when first key in data is assoc model
add extra tests for saveAll and validate first
ensure db values dont get reset to default values
2012-05-19 14:41:16 -04:30
Jose Lorenzo Rodriguez
307197da9e Merge branch '2.2' into 2.2-validator
Conflicts:
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Model/ModelValidationTest.php
	lib/Cake/Test/Case/Model/ModelWriteTest.php
2012-05-10 22:19:35 -04:30
Jose Lorenzo Rodriguez
7db2b97f87 Fixing error with validateMany and validateAssociated not saving values altered in beforeValidate callbacks 2012-05-10 20:55:47 -04:30
Jose Lorenzo Rodriguez
0fb025f6dc Fixing error with validateMany and validateAssociated not saving values altered in beforeValidate callbacks 2012-05-09 23:51:27 -04:30
Jose Lorenzo Rodriguez
52c7b2383c Added afterValidate callback to maintain consistency across all other callbacks in the model layer 2012-05-06 23:38:29 -04:30
Jose Lorenzo Rodriguez
d4511af27b Implemented add and remove in ModelValidator 2012-05-06 23:06:28 -04:30
Jose Lorenzo Rodriguez
3199b9029b Implemented countable interface for ModelValidator 2012-05-05 17:46:09 -04:30
Jose Lorenzo Rodriguez
81c0c3d91d Implementing IteratorAggregate interface for ModelValidator 2012-05-05 17:34:35 -04:30
Jose Lorenzo Rodriguez
d35f8e6b00 Implementing ArrayAccess in ModelValidator 2012-05-05 15:52:02 -04:30
Jose Lorenzo Rodriguez
843d95bb77 Renaming some methods ands removing others 2012-05-05 13:34:14 -04:30
Jose Lorenzo Rodriguez
bf0f5ab118 Merge remote-tracking branch 'origin/2.1' into 2.2 2012-04-29 20:05:39 -04:30
Jose Lorenzo Rodriguez
d348bf6807 Refactoring again CakeRule, making all tests pass 2012-04-29 18:11:51 -04:30
Jose Lorenzo Rodriguez
deedd7a3ce Even more tests passing now, almost there 2012-04-29 02:40:08 -04:30
Jose Lorenzo Rodriguez
66a568be89 More tests passing now 2012-04-29 01:09:36 -04:30
Jose Lorenzo Rodriguez
8700f3c7a2 Fixed some validation tests 2012-04-29 01:06:24 -04:30
Jose Lorenzo Rodriguez
30761f9153 Removed more redundant lines in ModelValidation tests 2012-04-29 00:46:56 -04:30
Jose Lorenzo Rodriguez
18c26119f3 Removing redundant code, cleaning up some sentences 2012-04-29 00:39:43 -04:30
Jose Lorenzo Rodriguez
c31f87b7a1 Refactored getMethods, got rid of validationErrors property in ModelValidator, made validateAssociated and many tests
pass
2012-04-29 00:24:35 -04:30
Jose Lorenzo Rodriguez
573d292ffa Fixed more refereces to old method 2012-04-28 20:12:20 -04:30
Kyle Robinson Young
b8488b8dfe Update 1.x @link in docblocks 2012-04-26 19:49:18 -07:00
Ceeram
ec9966ec6b Adding tests for Validator 2012-04-25 09:38:58 +02:00
Thomas Ploch
324684c14f Moving all validation logic into a new ModelValidator object. 2012-04-25 08:53:31 +02:00
ADmad
b1e7164d1a Implemented translation of validation rule arguments in validation error messages. Closes #2816 2012-04-22 23:25:07 +05:30
Kyle Robinson Young
90e7afbdc7 Correct parameter order of assertEquals and assertNotEquals 2012-03-22 23:37:12 -07:00
mark_story
dbb2dd44d7 Fix more coding standards. 2012-03-18 21:20:33 -04:00
Juan Basso
3b1bd90ad6 Updated copyright to 2012. 2012-03-12 22:46:07 -04:00
mark_story
7665f369fa Merge branch '2.1-type-hinting-corrections' into 2.1 2012-02-25 20:07:18 -05:00