Commit graph

878 commits

Author SHA1 Message Date
Henrique Moody 48a9fad2c2 Created rule "Writable".
This rule checks if the given data is a file exists and is writable.
2013-02-04 22:54:46 -02:00
Henrique Moody 7a6fb85b46 Created rule "Readable".
This rule checks if the given data is a file exists and is readable.
2013-02-04 22:51:45 -02:00
Henrique Moody daf660502a Created rule "SymbolicLink"
This rule checks if the given data is a path of a valid symbolic link.
2013-02-04 22:48:21 -02:00
Henrique Moody fa641ef175 Created rule "Exists"
This rule checks if the given data is a path of a regular file or
directory.
2013-02-04 22:10:36 -02:00
Henrique Moody 879f08aad1 Created rule "File"
This rule checks if the given data is a path of a regular file or not.
2013-02-04 22:03:54 -02:00
nickl- b88d224128 Test to ensure empty string is valid.
Updated all tests to ensure we don't fail an empty input, right across the board now. One rule for all but NotEmpty Class family. Instead of testing validate methods we should test against the __invoke method which is what validator uses. Updated all validate methods and calling __invoke directly in tests.
2013-01-25 05:20:13 +02:00
nickl- b8240bb0fc More tests through provider for no whitespace 2013-01-25 05:20:12 +02:00
nickl- 5c5d56a7ee More null value tests through provider 2013-01-25 05:20:12 +02:00
nickl- 65c4796048 More json tson tests through provider 2013-01-25 05:20:12 +02:00
nickl- 859c3640cd Make test Callback a little more reusable 2013-01-25 05:20:12 +02:00
nickl- 520480cfee Removed license from source file 2013-01-25 05:20:12 +02:00
nickl- dc6d23d520 Refactor rename Printable Prnt. 2013-01-25 05:20:12 +02:00
Andre Ramaciotti bcee7f4790 Fixed up OneOfTest after Xdigit renaming 2013-01-25 05:18:05 +02:00
Andre Ramaciotti b4cf198989 Changed Xdigit base class to AbstractCtypeRule
It also affects one of the test cases (the empty string went from
invalid to valid).
2013-01-25 05:18:05 +02:00
Andre Ramaciotti 8338143894 Renamed Xdigits to Xdigit, following Ctype naming convention 2013-01-25 05:18:04 +02:00
Andre Ramaciotti e8ff238885 Renamed Printable to Print to follow Ctype naming convention
This isn't working, the tokenizer recognizes 'Print' as the built-
in 'print' and not as a class name.
2013-01-25 05:18:04 +02:00
Andre Ramaciotti 2d2eee6b62 Renamed Punctuation to Punct to make it follow the Ctype naming 2013-01-25 05:18:04 +02:00
nickl- 2c9371e048 Fix:2 for #97 Refactor rename Vowels to Vowel.
As per #97 Plural rules no singular.
Vowels to Vowel.
Vowelss now a deprecated decorator class of Vowel.
Documentation updated.
2013-01-25 05:18:04 +02:00
Andre Ramaciotti e82f209ffd Graphical renamed to Graph to follow Ctype naming convention 2013-01-25 05:18:04 +02:00
nickl- 625d78bf90 Fix:1 for #97 Refactor rename Consonants to Consonant.
As per #97 Plural rules no singular.
Consonants to Consonant.
Consonants now deprecated.
Documentation updated.
2013-01-25 05:18:04 +02:00
Andre Ramaciotti a4620918ff Control renamed to Cntrl to follow Ctype naming convention 2013-01-25 05:18:04 +02:00
nickl- 898429ab07 Refactor rename Digits to Digit 2013-01-25 05:18:03 +02:00
nickl- cb5d578c69 Whitespace fixes only 2013-01-25 05:18:02 +02:00
nickl- 2839f49976 That shouldn't be there.
segfault test slipped into repo.
2013-01-25 05:18:02 +02:00
nickl- d2dd27852d Invalid test, it would appear.
This does not appear to be a valid test verifying an input string.
2013-01-25 05:18:02 +02:00
Andre Ramaciotti d22c33c371 Made OneOfTest use Xdigits instead of Hexa 2013-01-25 05:18:01 +02:00
Andre Ramaciotti 6ade820b9b Mark Hexa as deprecated
I've also changed its tests, setting an error handler that does
nothing.  Maybe we should check if E_USER_DEPRECATED is really
being triggered, but I'm not sure on how to do it.
2013-01-25 05:18:01 +02:00
Andre Ramaciotti ba9f012b0b New Xdigit rule based on the previous Hexa rule
This is a really ugly copy'n'paste.  There are two problems to
solve: how to make 'hexa' deprecated and how to make its use fall-
back to xdigits.

The simplest solution would be to put a if in Validator::buildRule,
but it's too hackish for my taste.
2013-01-25 05:18:01 +02:00
Andre Ramaciotti 04c1ef6726 Removal of $acceptEmptyString
Notice that this changes the behaviour of some rules (of Digits in
special).  That's why some lines from the tests appear in the diff,
they were removed from the invalid data provider and where put into
the valid data provider.
2013-01-25 05:18:01 +02:00
Andre Ramaciotti 2af3ffeef2 Removed duplicated rule Xdigits (there is Hexa already) 2013-01-25 05:18:00 +02:00
Andre Ramaciotti 679ce35662 New rule Space based on ctype_space 2013-01-25 05:18:00 +02:00
Andre Ramaciotti b8647dfa54 New rule Punctuation based on ctype_punct 2013-01-25 05:18:00 +02:00
Andre Ramaciotti 11b6cbd240 New rule 'Xdigit' based on ctype_xdigit 2013-01-25 05:18:00 +02:00
Andre Ramaciotti 86f7a6bc26 New rule Graphical based on ctype_graph 2013-01-25 05:18:00 +02:00
Andre Ramaciotti a643f6f125 New rule 'Printable' based on ctype_print
More tests would be nice, but I've run out of ideas.
2013-01-25 05:18:00 +02:00
Andre Ramaciotti 82f86d96bf Ctype rules now may accept or not the empty string
This will help wrapping some rules, as ctype_digit and ctype_cntrl
without breaking Alpha and Alnum.
2013-01-25 05:17:59 +02:00
Andre Ramaciotti 0a0c2116c5 Corrected method name 2013-01-25 05:17:59 +02:00
Andre Ramaciotti aa01218401 New Rule 'Control' based on ctype_cntrl
As it is implemented, it accepts an empty string as valid.  I'm
not sure if this should be the case, but changing this on the base
class breaks Alpha and Alnum.
2013-01-25 05:17:59 +02:00
Henrique Moody 0421ba0cd3 Renamed test methods of underscore to cammelcase. 2013-01-14 20:56:53 -02:00
Luís Otávio Cobucci Oblonczyk e08212ed17 Fix for 32bit integers 2013-01-14 12:35:04 -02:00
Luís Otávio Cobucci Oblonczyk 86f91ad978 Implemented IP range validation (#95) 2013-01-09 12:48:11 -02:00
Augusto Pascutti 2e6fe3a148 Fix Travis: make it use composer.
- Refactor Zend validator tests
- Fixed my email on composer.json
- Added dev packages in composer.json:
    - Zend\Validator 2.*
    - Symfony\Component\Valitor 2.*

PS: This is just a quick fix before Foundation can run this on his
    own.
2012-12-18 01:55:33 -02:00
Alexandre Gaigalas 4625d1c24e Charset Validator 2012-12-06 23:31:24 -02:00
Alexandre Gaigalas 18a7a53362 Testing key validator names 2012-12-04 14:30:59 -02:00
Alexandre Gaigalas bf3c95a460 Removing accidental var dump 2012-12-04 14:21:11 -02:00
Alexandre Gaigalas f0ac111d24 Tests for issue 85 2012-11-26 22:51:29 -02:00
Kinn Coelho Julião eb519fdc55 Updated CNH validator with Exceptions
Created new Exception for CNH Validator
2012-11-25 22:55:16 -02:00
Kinn Coelho Julião 18e48b514d CNH Validator
Brazilian driver's license validator
2012-11-25 22:22:59 -02:00
nickl- 0580308f68 Zend\Validator\Alnum does not exist 2012-07-25 04:55:55 +02:00
nickl- dca743e94d Updated bootstrap with full composer and pear compatibility 2012-07-24 03:01:44 +02:00
Carlos André Ferrari f2c723f869 Added Base validator
This validator is made to validate numbers in any base, even with custom bases

It also have a shortcut, you can use something like
v::base3()->assert('0212');
instead of
v::base(3)->assert('0212');

You can also use custom numeric sequences, like
v::base(3, 'xy')->assert('xyxyx');
2012-07-22 10:17:31 -03:00
Alexandre Gaigalas dedb7da7c0 Added AlwaysValid and AlwaysInvalid validators for mocking and testing purpouses 2012-05-24 12:07:29 -03:00
Alexandre Gaigalas 2c67ed148d Added CountryCode Validator 2012-05-24 12:00:18 -03:00
Alexandre Gaigalas 90d370b8a6 Another try to fix not() shortcuts 2012-05-17 16:16:45 -03:00
Alexandre Gaigalas deedd3dddc Possible fix for #74 2012-05-17 15:51:49 -03:00
Vicente Mendoza c9f0c05f57 add shorcuts not and addOr 2012-05-05 19:06:13 -05:00
Alexandre Gaigalas e89e1df630 Fixed bug with date formats 2012-04-24 23:52:37 -03:00
Henrique Moody 64588c3ef8 Fixed directory test error in PHP 5.4 2012-04-11 16:08:57 -03:00
Henrique Moody d560c601b8 Created rule for directory validation. 2012-04-11 16:00:18 -03:00
Alexandre Gaigalas 969aa8cf9a Ops, commited broken test 2012-04-08 22:46:30 -03:00
Alexandre Gaigalas 455ca0c8cf Fixed bug with additionalChars in alpha and its children 2012-04-08 22:44:35 -03:00
Alexandre Gaigalas 71f4af32a3 Fixed bug with allOf message template 2012-04-08 22:27:25 -03:00
Alexandre Gaigalas 78c0a9023a Merge branch 'develop' 2012-04-08 19:58:36 -03:00
Alexandre Gaigalas c4495a61c8 Better readme and some tweak on Roman 2012-04-08 19:55:05 -03:00
Alexandre Gaigalas 926b67a0b7 New README on its way, some fixes 2012-04-08 19:08:39 -03:00
Alexandre Gaigalas 7d888f135f Tests and small fixes 2012-04-08 05:30:44 -03:00
Alexandre Gaigalas 9f21396896 Trying to fix travis 2012-04-07 23:19:18 -03:00
Alexandre Gaigalas 731d47b7a3 Refactoring some validators to utf-8 and improving code readability 2012-04-07 21:37:37 -03:00
Alexandre Gaigalas e27c931a75 Merge branch 'develop' of github.com:Respect/Validation into develop 2012-04-07 20:42:19 -03:00
Henrique Moody 8ec8dfb260 Create validator for versions. 2012-04-07 14:50:52 -03:00
Alexandre Gaigalas cf3b4fc388 When rule for conditional validation 2012-04-05 22:03:41 -03:00
Alexandre Gaigalas 3b4f05b8eb Merging develop 2012-03-29 14:12:19 -03:00
Alexandre Gomes Gaigalas 11e291975e Merge pull request #69 from kleberhs007/consonant_validation
Insert validation, unit test and exception for consonants.
2012-03-28 09:38:14 -07:00
Kleber Hamada Sato 43a11cf9c5 Insert validation, unit test and exception for consonants.
Signed-off-by: Kleber Hamada Sato <kleberhs007@yahoo.com>
2012-03-27 15:26:52 -03:00
Alexandre Gomes Gaigalas fee92ca6c5 Merge pull request #67 from kleberhs007/vowel_validation
Insert vowel validation, tests and exceptions.
2012-03-27 03:28:26 -07:00
Kleber Hamada Sato 30857349a2 Inserts vowel validation, tests and exceptions.
Signed-off-by: Kleber Hamada Sato <kleberhs007@yahoo.com>
2012-03-27 00:26:31 -03:00
Alexandre Gaigalas 87621e346f Removed incomplete filter/sanitize support 2012-03-22 23:07:17 -03:00
Alexandre Gaigalas b364382f3d Fix #64 2012-03-22 22:12:07 -03:00
Alexandre Gaigalas 7ba352e905 Added test for #64 2012-03-22 21:55:27 -03:00
Alexandre Gaigalas 7148a09722 Added test for #64 2012-03-22 21:54:29 -03:00
Kleber Hamada Sato 21aa5bf0a0 Insert validation, tests and exception for perfect square numbers.
About perfect square numbers:
Perfect square numbers are numbers which is a product of some integer
with itself. A square root of a perfect square numbers is always a integer
number.

Signed-off-by: Kleber Hamada Sato <kleberhs007@yahoo.com>
2012-03-20 13:24:55 -03:00
Kleber Hamada Sato 0cd76d0346 Correct method from testInvalidFormattedCpf to testInvalidSlug, because
this method verifies a slug , not a CPF number.

Signed-off-by: Kleber Hamada Sato <kleberhs007@yahoo.com>
2012-03-19 13:58:39 -03:00
Kleber Hamada Sato 11ecf0b95e Change file PrimeNumberTest to PrimeNumberTest.php
Signed-off-by: Kleber Hamada Sato <kleberhs007@yahoo.com>
2012-03-14 16:37:51 -03:00
Kleber Hamada Sato 61d5e9b452 - Inserts copyright comments in PrimeNumberTest.
- Modifies the exception class name to PrimeNumberException and modifies
  the copyright current year to 2012.

Signed-off-by: Kleber Hamada Sato <kleberhs007@yahoo.com>
2012-03-13 23:51:48 -03:00
Kleber Hamada Sato 9777f22329 - Modifies PrimeNumber.php to accept zero value or a number under zero.
Returns: false

- Inserts PrimeNumberTest.php file with the Unit Test.

- Inserts PrimeNumberTest.php file with the exceptions validation.

Signed-off-by: Kleber Hamada Sato <kleberhs007@yahoo.com>
2012-03-13 23:46:24 -03:00
Torben Brodt 26af736f84 remove unused namespace use statements 2012-02-05 16:13:34 +01:00
Fábio da Silva Ribeiro 7a6020b25d Add MacAddress Validation with tests 2011-12-05 20:31:52 -02:00
Alexandre Gaigalas abcff11611 Improved tests, new makefile 2011-11-29 19:20:07 -02:00
Alexandre Gaigalas 32efa03d22 Automation improvements 2011-11-25 18:03:48 -02:00
Alexandre Gaigalas cdf3b2992a boostrap fix 2011-11-25 15:33:18 -02:00
Alexandre Gaigalas 8bc2e0dca3 Zend Framework dependencies on Makefile 2011-11-25 15:28:12 -02:00
Alexandre Gaigalas 312b8ab192 Travis tests 2011-11-24 19:59:33 -02:00
Alexandre Gaigalas 6f9d9fad96 Changed phpunit.xml location file 2011-11-24 19:51:55 -02:00
Jean Pimentel b2015106ae Renamed RomanTest 2011-10-25 16:12:22 -02:00
Jean Pimentel 84d8fcdff4 Added Roman Numbers Validator 2011-10-25 16:06:43 -02:00
Alexandre Gomes Gaigalas 32de8bae81 Merge pull request #51 from jeanpimentel/creditcard
Added CreditCard Validator
2011-10-23 09:40:47 -07:00
Jean Pimentel c4119fab82 Added CreditCard Validator 2011-10-23 12:37:14 -02:00
Jayson Reis 8fc2492181 geez, more missed tabs 2011-10-19 21:34:37 -02:00
Jayson Reis a247eb2fc7 ported cnpj validator from js from hell 2011-10-19 20:46:51 -02:00
Jayson Reis 8d5fdeacd0 some changes in cnpj validators tests 2011-10-18 16:26:05 -02:00
Jayson Reis 13c9c7c759 started cnpj validator 2011-10-18 15:48:26 -02:00
Jayson Reis edc2d77f3a rewrote of leap date validator so tests will not be fake anymore 2011-10-18 10:51:32 -02:00
Jayson Reis 82846a4347 improved LeapYear validator 2011-10-18 10:28:36 -02:00
Jayson Reis 475937e66e leap year test 2011-10-18 10:28:36 -02:00
Alexandre Gaigalas f2bebc6342 Merge branch 'develop' of https://github.com/Respect/Validation into develop 2011-10-17 22:29:15 -02:00
Alexandre Gaigalas 41286de8b5 Filter and sanitizing prototype update 2011-10-17 22:29:08 -02:00
Alexandre Gaigalas 50a15db9db Added tests for convertable dates 2011-10-17 22:28:31 -02:00
Alexandre Gaigalas f775808c69 Leap date coding style 2011-10-17 22:27:50 -02:00
Jayson Reis f8d75cc022 fixed wrong protected name in LeapDateTest 2011-10-17 21:59:31 -02:00
Jayson Reis 2b632794ae leap date stuff 2011-10-17 21:45:31 -02:00
Alexandre 5bf3f19653 Fixed critical bug thanks to @EduardoLopes 2011-10-08 21:38:41 -03:00
Alexandre Gomes Gaigalas 8246440a54 Merge pull request #36 from jeanpimentel/lowercase
Added Lowercase Validator
2011-10-05 20:19:41 -07:00
Jean Pimentel bc4ad1e850 Modified to use mb_strtoupper if exists 2011-10-06 00:07:49 -03:00
Jean Pimentel 9be7aa357d Modified to use mb_strtolower if exists 2011-10-06 00:05:14 -03:00
Jean Pimentel 9fb162199e Added Uppercase Validator 2011-10-05 22:48:16 -03:00
Jean Pimentel ce2584c18a Added Lowercase Validator 2011-10-05 22:19:43 -03:00
Alexandre Gaigalas cf1fc85caa Fixed lots of tests, improved their clarity a lot. Fixed also OneOf, Key and Each validators for some edge cases 2011-10-05 21:07:15 -03:00
Alexandre Gaigalas 557330cbfa Fixed Each validator and improved its tests 2011-10-05 20:17:42 -03:00
Alexandre Gaigalas 88f0d82cce Improved several tests, fixed bug on Arr::check() that was calling methods on non-objects 2011-10-05 20:05:36 -03:00
Alexandre 15553b309d Small fixes on Cpf, Json, Odd, Even and Slug 2011-10-05 00:19:20 -03:00
Alexandre 77f237f9a2 Small fixes on Cpf, Json, Odd, Even and Slug 2011-10-05 00:19:03 -03:00
Alexandre 6d042f7c28 Changed capitalisation from JSON to Json to match libraries standards 2011-10-05 00:09:07 -03:00
Alexandre c81b2b75ec Filtering module prototype 2011-10-05 00:03:48 -03:00
Alexandre 734fb96121 Added assertions for samples 2011-10-05 00:03:35 -03:00
Carlos André Ferrari 7e956c563f Added Slug validator 2011-09-25 09:01:28 -03:00
Jean Pimentel c58eecf729 Remove Date Validator in MinimumAge Validator 2011-09-24 12:25:26 -03:00
Jean Pimentel 9cf3edc42a Remove Length validator in Cpf Validator 2011-09-22 19:20:24 -03:00
Jean Pimentel b883a2ac7b Remove Int validator 2011-09-22 17:41:07 -03:00
Jean Pimentel afb16fcb60 Added Even/Odd Validator 2011-09-22 00:49:42 -03:00
Jean Pimentel 71d3e218fe Fixing CPF Validator 2011-09-19 22:13:10 -03:00
Jean Pimentel f12a95c1b3 Added Minimum Age Validator 2011-09-18 21:31:40 -03:00
Alexandre Gomes Gaigalas a5863a471b Fixed Zend dependency thanks to @crodas 2011-09-14 21:02:12 -03:00
Jean Pimentel 42252c4a31 Added Multiple Validator 2011-09-13 23:47:59 -03:00
Jean Pimentel d1112896d0 Added Multiple Validator 2011-09-13 23:46:18 -03:00
Devin Torres 6d51b35efa Add Bool rule 2011-09-13 10:19:04 -05:00
Jair Henrique 65cc12d93b Improves CPF and JSON classes and testes 2011-09-05 23:34:00 -03:00
Jair Henrique 9aafcaceb0 - Add CPF Validation
- Fix coding standars on JSON Validation
2011-09-03 19:20:02 -03:00
Jair Henrique 0067b0a641 Include JSON validation 2011-09-02 21:27:57 -03:00
Alexandre cb6a14e02e Fixed nested messaging for grouped exceptions. 2011-08-10 23:05:35 -03:00
unknown 2fbdf14992 Change regexp validator for possible use modificators 2011-05-04 15:01:38 +04:00
unknown 0615574123 Fix return value email validator
add tests for email validator
2011-05-04 13:19:55 +04:00
Alexandre Gomes Gaigalas cdafd4b1ff Testes, fixed last merge. 2011-05-03 10:31:31 -03:00
Alexandre Gomes Gaigalas 67c789fa92 Added {{input}} param on AbstractRule 2011-04-29 16:17:20 -03:00
Alexandre Gomes Gaigalas e635db4a19 New API for findRelated() and findMessages() on AbstractNestedException 2011-04-29 16:00:39 -03:00
Alexandre Gomes Gaigalas 1ae18f2f5a Fixed key validator error on non-array input. 2011-04-28 11:04:57 -03:00
Alexandre Gomes Gaigalas 5d7a9e191d Removed AtLeast and MostOf (pointless validators). Lots of fixes and new tests and assertions. >96% code coverage achieved. 2011-04-27 20:41:12 -03:00
Alexandre Gomes Gaigalas 63cc857801 Cleanup on Validator class (removed some old stuff that i don't even know how ended up there), fixed findMessages and findRelated quirks 2011-04-27 14:35:12 -03:00
Alexandre Gomes Gaigalas d254d466cc Fixed Rules\Attribute and Rules\Key on non-mandatory rule checking. 2011-04-27 11:07:17 -03:00
Alexandre 3ed3114e58 Added AbstractRule->setTemplate to support custom template messages. 2011-04-17 12:29:48 -03:00
Alexandre Gomes Gaigalas 9b04572604 Fixed E_DEPRECATED 2011-04-14 19:32:48 -03:00
Alexandre 9b6da3e3e2 Better Rules\Not() implementation. Works on composite rules now. 2011-04-09 21:00:50 -03:00
Alexandre cc278caffd Revert "Revert "Message modes for exceptions (in draft)""
This reverts commit 2041d4a33a.
2011-04-09 20:34:21 -03:00
Alexandre 2041d4a33a Revert "Message modes for exceptions (in draft)"
This reverts commit 6f0dd5c072.
2011-04-09 20:30:49 -03:00
Alexandre Gomes Gaigalas 6f0dd5c072 Message modes for exceptions (in draft) 2011-04-08 16:39:10 -03:00
Alexandre Gomes Gaigalas 2e8dd7b171 Export exceptions to plain arrays (to use in template engines, for example) 2011-03-30 19:06:59 -03:00
Alexandre 10813d136e Licensing. 2011-03-13 11:50:47 -03:00
Alexandre 0b37041481 Not validator for negating rules (v::not(v::string()) means not string). Improvements on the Domain validator. Needs Refactoring. 2011-02-21 00:42:32 -03:00
Alexandre 191065bf4c Very early stage Internet Domain Name validators. New Contains and Tld (top-level domain) validators. NoWhitespace now validates for null values. 2011-02-20 21:53:21 -03:00
Alexandre b12b81685e StartsWith and EndsWith validators 2011-02-20 15:54:11 -03:00
Alexandre 62f19fe798 New tests for exceptions. 2011-02-20 15:03:09 -03:00
Alexandre 91da403137 -Merge branch 'develop' of github.com:Respect/Validation into develop
-Fixed package.xml
Conflicts:
	library/Respect/Validation/package.xml
2011-02-20 14:07:00 -03:00
Alexandre 47e8c47e9e Cleanup, fixed AbstractRelatedException inheritance problems. 2011-02-20 13:59:53 -03:00
Alexandre b13ef8f072 More compositing messages adjustments 2011-02-19 17:47:34 -02:00
Alexandre 45b4a4dfad Fixed composite exceptions 2011-02-18 23:07:14 -02:00
Alexandre Gomes Gaigalas 1e48eb3ee1 Changed test to work on 32bit systems 2011-02-18 11:00:25 -02:00
Alexandre 28603d74a3 Improved message compositing and iteration. Cleanup. 2011-02-18 01:08:46 -02:00
Alexandre 895ce93ed1 - Splitted up ValidationException into simple exceptions and composite exceptions
- Changed the string formater from sprintf to custom function. Exception parameters should be more readable now.
	- Several refactorings on the exception reporting model
	- Improved builders ( new v(array('int', 'positive', 'between'=>array(1,256))); is now possible, great for dependency injection.
	Note: There are nasty things on this commit. Duplicated code, orphan methods and such. Next step is a nice quality-wide refactoring.
2011-02-10 18:49:48 -02:00
Alexandre bf5ed1e64d Changes in the bootstrap, replaced SplClassLoader for a lighter implementation. 2011-02-09 18:39:32 -02:00
Alexandre 4e068bf204 -Messages are now imperative ("foo must be bar") instead of informative ("foo is not bar").
-Several improvements on the messaging system and error reporting, lots of refactored code.
-Validators can now be safely named $val->setName('My Field'), and that name will reflect on the validation message ("My Field must be bla bla bla" instead of "incorrect value" must be bla bla bla)
2011-02-08 20:10:58 -02:00
Alexandre e46dc1d36c Hide exception messages on tests 2011-02-07 12:23:24 -02:00
Alexandre 822fd269f8 Better README, fixed bugs on AllOf and AlphaException 2011-02-07 12:22:30 -02:00
Alexandre 58c16154e4 Guess I woke up today a little obsessive. Sorted all the class declarations/methods/properties/namespace imports in alphabetic/visibility order. 2011-02-07 08:52:18 -02:00
Alexandre c7db33ad54 Removed unstable files from master, see the develop branch https://github.com/Respect/Validation/tree/develop 2011-02-06 23:17:21 -02:00
Alexandre 6c0573e171 New README, fixes on positive and negative validator messages 2011-02-06 20:51:50 -02:00
Alexandre 8098321bcd A lot of refactoring, tests on ValidationException, improvements on AllOf::validate 2011-02-06 20:21:15 -02:00
Alexandre e252c404ba Some refactoring, new tests 2011-02-05 15:32:21 -02:00
Alexandre 99996267d9 ValidationException->findRelated can now be used to find child exceptions. It should be easy to report messages now. 2011-02-03 20:16:58 -02:00
Alexandre 35c4d5febe -ExceptionIterator now can be configured to skip composite redundant messages or iterate over them all
-Rules\Each improvements and new tests, now can validate array keys too. Better exception reports for it.
-A very abrangent test including several cases on ValidatorTest
2011-02-02 00:28:02 -02:00
Alexandre (@alganet) 5830711f5a Several Improvements:
-Simplified defaultTemplates on Exceptions
	-Exceptions now can be iterated and recursively iterated
	-Messages built by RecursiveTreeIterator (SPL), faster an simpler
	-attribute, key and composite exceptions message plays nicer (no redundant messages)
2011-01-30 22:17:06 -02:00
Alexandre Gomes Gaigalas 9a5536dd69 Several new validators (Int, In, Negative, Positive, String). Refactored Length to work with strings and arrays. Better tests for several validators. Updated README and PEAR package file. 2010-12-07 17:17:43 -02:00
Alexandre Gomes Gaigalas b3cc2285fc Less Reflection on Validator, better tests for AllOf 2010-12-07 10:11:14 -02:00
Alexandre Gomes Gaigalas 71b510cd51 Equals validator for equality/identity. Tests for AbstractRelated 2010-12-07 10:02:57 -02:00
Alexandre Gomes Gaigalas 32c5fe4ce0 Refactoring on AbstractRelated, Call validator for validating inputs after passing them for a callback 2010-12-06 19:00:28 -02:00
Alexandre Gomes Gaigalas 92d7c1e919 New Each validator. Removed Traversable and refactored Arr. Moved check() to AbstractRule, just the rules that need to overload it now implement it. 2010-12-06 16:30:56 -02:00
Alexandre Gomes Gaigalas 35aee77111 Refactored names for some validators 2010-12-05 23:17:12 -02:00
Alexandre Gomes Gaigalas f776bde6b8 Refactored HasKey, HasAttribute, HasOptionalKey and HasOptionalAttribute into AbstractRelated 2010-12-05 22:44:05 -02:00
Alexandre Gomes Gaigalas 0dceb11976 Refactoring on some validators. Still need refactoring on many of them 2010-12-05 18:26:04 -02:00
Alexandre Gomes Gaigalas 248fbdcf4f More stable Exceptions API 2010-12-03 19:36:46 -02:00
Alexandre Gomes Gaigalas 42999f796a Very unstable commit. Lot of changes to the exception model. 2010-12-02 19:04:10 -02:00
Alexandre Gomes Gaigalas 1c15766fcd Rules for Traversable items 2010-12-01 11:08:18 -02:00
Alexandre Gomes Gaigalas de3c73ab91 New rule for Traversable objects (arrays, arrayobjects, etc) 2010-11-30 17:53:22 -02:00
Alexandre Gomes Gaigalas ae952fa073 Now HasAttribute works on private, protected and inacessible attributes. 2010-11-30 14:21:33 -02:00
Alexandre Gomes Gaigalas 2408730f48 Changed the Exceptions to Match Rules names 2010-11-30 13:36:04 -02:00
Alexandre Gomes Gaigalas 460b744ee1 README update, deleted old files 2010-11-09 13:32:08 -02:00
Alexandre Gomes Gaigalas 234f74a058 Refactored one, all, most and none to oneOf, allOf, noneOf and mostOf 2010-11-09 01:35:19 -02:00
Alexandre Gomes Gaigalas b403f67739 Small fix 2010-11-09 00:32:36 -02:00
Alexandre Gomes Gaigalas f9b98679b2 Optional key and attribute validators 2010-11-08 23:56:28 -02:00
Alexandre Gomes Gaigalas 0d4e686a26 Rules for types: array, object, instances 2010-11-08 22:37:50 -02:00
Alexandre Gomes Gaigalas 1d7a721298 Faster validation for compositing rules, new check() method for validators 2010-10-18 07:15:44 -02:00
Alexandre Gomes Gaigalas 1d1c5d4b4c Removed nasty eval'd code from tests 2010-10-18 06:40:44 -02:00
Alexandre Gomes Gaigalas bc63da4e0e Major refactoring on the validation exceptions and messages. 2010-10-18 06:18:46 -02:00
Alexandre Gomes Gaigalas 87f88ae641 HasKey validator for arrays, tests improved on HasAttribute validator 2010-10-18 03:41:22 -02:00
Alexandre Gomes Gaigalas 605b6b00fa Changed some methods to protected 2010-10-18 03:24:19 -02:00
Alexandre Gomes Gaigalas f8639f488a Improvements on date validation and tests 2010-10-18 03:05:37 -02:00
Alexandre Gomes Gaigalas 611dbc1cd6 Parameter validation for Callback validator 2010-10-18 02:53:20 -02:00
Alexandre Gomes Gaigalas c29295a4d0 Better tests, parameter validation for Alnum and Alpha 2010-10-18 02:48:13 -02:00
Alexandre Gomes Gaigalas f18d700b9f New validators for numbers (digits, float, hexa, etc), alpha, regex, generic between, ip addresses. Improvements on several existent validators. 2010-10-18 02:26:02 -02:00
Alexandre Gomes Gaigalas d934d5c28e removed old file 2010-10-17 22:38:25 -02:00
Alexandre Gomes Gaigalas 0d3487679b Fixed a nasty bug on StringLength validator identified by Augusto.
Merged the NumericBetween validator also created by Augusto.
Fixed a bug on the Zend and Sf tests that skipped tests inapropriately.
2010-10-16 20:40:04 -03:00
Augusto Pascutti b9a7e1efe1 Added NumericBetween and its tests. Made some more dataProviders for some tests. 2010-10-17 07:02:22 +08:00
Augusto Pascutti a34946a7e3 Changed SplClassLoader to work better with class_exists() and changed external lib tests to check for vendor classes first. 2010-10-17 07:02:28 +08:00
Alexandre Gomes Gaigalas df3533c9c8 Refactored all mentions of "message" to "message template" for further refactorings 2010-10-06 18:27:14 -03:00
Alexandre Gomes Gaigalas a2fbdc340f New Sf valitador that uses Symfony 2.0 Validators and Constraints. Moved Zend validator to support only the 2.x ZF. 2010-10-06 18:06:55 -03:00
Alexandre Gomes Gaigalas fc661bcfec Added Zend Validation support 2010-10-06 15:52:06 -03:00
Alexandre Gomes Gaigalas 27c7739abd Callback validation, fixed bootstrap 2010-10-05 12:55:12 -03:00
Alexandre Gomes Gaigalas ffb2e3cdb5 Readme 2010-09-27 18:44:56 -03:00
Alexandre Gomes Gaigalas 82e26fa159 New Validators 2010-09-27 18:02:30 -03:00
Alexandre Gomes Gaigalas b43371315a Major refactoring. Removed a layer from the validator rules, now all of them have a single level. Simplified fluent interface (chains and static validators), improved folder organization. 2010-09-26 02:16:02 -03:00
Alexandre Gomes Gaigalas 0491cd885f Turned Fluent Interface into a composite validator by nature, added support for chained composite validations, small fix on String\NotEmpty validator 2010-09-25 01:48:49 -03:00
Alexandre Gomes Gaigalas 9bcdb56189 Refactored "validator" name to "rule" in many places, fluent interface improvements, validatior chaining for fluent interfaces and small fixes 2010-09-25 01:13:26 -03:00
Alexandre Gomes Gaigalas 47f0543ecf Readme fix 2010-09-24 21:39:22 -03:00
Alexandre Gomes Gaigalas d25f7220dc Fluent interface for Valitation\Validator, draft string validator, better tests, composite validation improvements 2010-09-24 21:28:03 -03:00
Alexandre Gomes Gaigalas 5850afdad5 CompositeValidator split in two (All and One), removed Chain for further rewrite 2010-09-24 15:46:59 -03:00
Alexandre Gomes Gaigalas 9aee2ea16d Name refactorings, interface for simple validator calls, date improvements 2010-09-24 00:32:00 -03:00
Alexandre Gomes Gaigalas 348cb019fe Optional Abstract Validator which implements messages methods, better message handling 2010-09-23 23:30:16 -03:00
Alexandre Gomes Gaigalas 666c0d5330 Better exceptions (component exceptions separate from validation exceptions), date default timezone on bootstrap, Date\Between validator 2010-09-23 22:56:17 -03:00
Alexandre Gomes Gaigalas f6871cbc7d Chain validators, better tests 2010-09-23 20:24:22 -03:00
Alexandre Gomes Gaigalas 2043c1129c Validator composite structure and tests, base for new Validators 2010-09-23 16:46:46 -03:00