Commit graph

304 commits

Author SHA1 Message Date
William Espindola 4976fbaf48
Apply contribution guidelines to "Contains" rule
Co-Authored-By: Henrique Moody <henriquemoody@gmail.com>
2018-06-04 09:11:58 +02:00
Danilo Benevides d1932b2e7f
Apply contribution guidelines to "Uppercase" rule
Also make sure that "Uppercase" only accepts strings.

Co-Authored-By: Henrique Moody <henriquemoody@gmail.com>
2018-06-02 16:03:11 +02:00
Henrique Moody df9ae14100
Apply contribution guidelines to "IterableType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-06-01 14:23:41 +02:00
Henrique Moody 24c2ba8faa
Make "Min" always inclusive
Since the rule "GreaterThan" was created, there is no reason to allow
"Min" to not be inclusive.

Also apply contribution guidelines to the rule.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-31 17:14:23 +02:00
Emmerson Siqueira 9eb159f3d9
Rename "MaximumAge" and "MinimumAge" rules
Those rules were renamed to keep consistent with other rules such as
'Max' and 'Min'.

Signed-off-by: Emmerson Siqueira <emmersonsiqueira@gmail.com>
2018-05-31 17:01:15 +02:00
Emmerson Siqueira 271ddd1fe0
Rename 'Prnt' rule to 'Printable'
This changes the rule name in order to be more descriptive and explicit
(avoid abbreviation). It also applies the new contribution guidelines.

Signed-off-by: Emmerson Siqueira <emmersonsiqueira@gmail.com>
2018-05-31 16:00:43 +02:00
Henrique Moody 6351f7a092
Make "Max" always inclusive
Since the rule "LessThan" was created, there is no reason to allow "Max"
to not be inclusive.

Also apply contribution guidelines to the rule.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-31 15:51:57 +02:00
Henrique Moody 9b20d6dae2
Create "GreaterThan" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-31 14:47:22 +02:00
Henrique Moody 9d0d750a18
Create "LessThan" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-31 14:01:45 +02:00
paul karikari 51ec5e1b95
Apply contribution guidelines to "Even" rule
Also add an extra validation to the rule, not allowing non-integers to
be considered as even numbers.

Co-Authored-By: Henrique Moody <henriquemoody@gmail.com>
2018-05-31 08:37:38 +02:00
Henrique Moody 71ecea32e6
Make getMessages() return the names or ids as keys
This method change the behavior of "getMessages()" by changin the keys
of its return to the "id" of the specific exception that was triggered.

It also allows users to overwrite the templates by passing an array to
it.

This is being requested by many users for a long time. It took that long
because I was thinking too much about how to improve the old method
called "findMesssage()" that I didn't realize that it could be done in a
easier way with the "getMessages()".

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-28 08:38:30 +02:00
Henrique Moody 8c529c433e
Refactor ValidationException
Make the ValidationException a little bit less mutable than before. All
its dependencies are now passed into the constructor.

This commit also make the Factory pass the translator to the exceptions
allowing to define the translator before the exception gets created.
This change is not the ideal one, later I would like to not need the
Singleton from the Factory to do that, but for now it seems like a good
approach.

One more thing that this commit does is to introduce the "id" for
Exceptions. Key can be either the defined "name" or the name of the rule
that throwed the exception. This method will be handy to identify
exceptions better.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-27 16:12:05 +02:00
Henrique Moody 64ec329663
Remove findMessages() from NestedValidationException 2018-05-27 16:12:05 +02:00
Henrique Moody c26db7287f
Use getMessage() instead of getMainMessage()
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-27 16:12:05 +02:00
Henrique Moody bc472a6f0e
Fix coding standards
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-24 08:46:49 +02:00
Henrique Moody e203f8aec5
Apply contribution guidelines to "ObjectType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-19 19:12:59 +02:00
Henrique Moody 34d42a0d70
Apply contribution guidelines to "CallableType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-19 17:07:59 +02:00
Bram Van der Sype 7b5a2928ff Apply contribution guidelines to "NotEmpty" rule 2018-05-02 16:04:05 +02:00
Emmerson Siqueira 2bcc164b35
Apply contribution guidelines to "ArrayVal" rule
Signed-off-by: Emmerson Siqueira <emmersonsiqueira@gmail.com>
2018-04-02 23:19:22 +02:00
Henrique Moody bfdea5b5bd
Apply contribution guidelines to "ResourceType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-03-27 00:44:48 +02:00
Henrique Moody ad9cab5daf
Apply contribution guidelines to "NullType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-03-27 00:32:05 +02:00
Henrique Moody 435187298a
Apply contribution guidelines to "IntType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-03-27 00:25:26 +02:00
Henrique Moody ec8cb734b3
Apply contribution guidelines to "FloatType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-03-27 00:17:34 +02:00
Henrique Moody 8465180062
Apply contribution guidelines to "BoolType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-03-27 00:09:58 +02:00
Henrique Moody 8ad7b208c2
Fix coding standards in PHPT file 2018-03-26 23:25:20 +02:00
Emmerson Siqueira ad61c49eca Apply contribution guidelines to "ArrayType" rule 2018-03-16 11:19:14 +01:00
Henrique Moody 2069e706b8
Apply contribution guidelines to "StringType" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
Co-authored-by: Emmerson Siqueira <emmersonsiqueira@gmail.com>
2018-03-09 15:56:10 +01:00
Henrique Moody 848c57d5ed
Apply contribution guidelines to "ScalarVal" rule
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
Co-authored-by: Emmerson Siqueira <emmersonsiqueira@gmail.com>
2018-03-09 15:07:58 +01:00
Henrique Moody 60e3fc3740
Refactor "Between" rule
The "Between" rule was extending the "AllOf" rule and adding "Max" and
"Min" rules to the chain. Because of that, when the rule failed we could
get the "MinException" or the "MaxException" exception, and only if both
failed that we would get the "BetweenException".

With this change it will always get the "BetweenException" which makes
it more explicit.

Also, the "Between" is not using the same standard required in the
Contribution Guidelines.
2018-03-03 18:06:26 +01:00
Henrique Moody 8d44bc3407
Refactor rules related to age
The "Age" rule was removed because it had too many responsibilities.
Instead "MaximumAge" was created (since there is already "MinimumAge").

This commit also introduces "AbstractAge" rule that is been used in both
mentioned rules.
2018-02-24 09:28:54 +01:00
Henrique Moody fb2ebaf5d6
Apply contribution guidelines to "DateTime" rule
This commit also makes some changes in how the `DateTime` rule behaves,
by not accepting `DateTimeInterface` as valid when a format is given.

Also:
- Create `DateTimeHelper` to eliminate some code duplication;
- Create integration tests for `DateTime` rule;
- Rename "format" placeholder to "sample" in the message;
- Update documentation of "DateTime" rule.
2018-01-30 20:17:10 +01:00
Henrique Moody 2007c7dc6e
Create "Time" rule 2018-01-30 09:47:41 +01:00
Henrique Moody 0db1cd6e1b
Create "Date" rule 2018-01-29 09:39:57 +01:00
Henrique Moody c80524b457
Method assert() should not have a return value
One this method should throw an exception when the input is not valid,
returning `TRUE` when it succeeds is not really consistent.
2018-01-28 17:38:40 +01:00
Henrique Moody 2a2bb6dd76
Apply contribution guidelines to "Identical" rule 2018-01-15 09:35:22 +01:00
Henrique Moody 02b51782c3
Apply contribution guidelines to "Equals" rule 2018-01-15 09:16:45 +01:00
Henrique Moody 2d7e2ea48f
Add "respect/stringifier" as dependency
Due to this change it was possible to identify that NotEmptyException,
and NotOptionalException where not working as they should. A fix was
made along with this commit.
2018-01-06 14:07:03 +01:00
Henrique Moody ef975629f3
Changes on PHP-CS-Fixer configuration
Because of `declare(strict_types=1)` some changes were necessary.
2018-01-04 17:59:37 +01:00
Henrique Moody b10206bd28
Merge branch '1.1' 2018-01-02 22:57:58 +01:00
Henrique Moody ee9e69776a
Merge branch '1.0' into 1.1 2018-01-02 22:47:22 +01:00
Henrique Moody 37a71de7d0
Try to find template from default templates first
When executing `ValidationException::setTemplate()` using a template
key, it does not try to select the template, but instead it uses the
template key as the template itself.

In order to fix this behaviour, there is now a check for a key with the
defined template. In case the template was not found, use the defined
template as the template itself.
2018-01-02 21:56:07 +01:00
Jens Segers 7d42813fb7
Create "Base64" rule 2017-10-15 19:38:31 +02:00
Ian d65e713080
Improve grammar of "Equals" rule 2017-10-15 18:27:36 +02:00
Henrique Moody 0338e18e83
Rename rule "Date" to "DateTime"
Also change rules to use `DateTimeInterface` and `DateTimeImmutable`
when possible.
2017-05-01 13:16:59 +02:00
Vitaliy 82f53d27e1
Create "Number" rule 2017-04-19 09:49:58 +02:00
Krzysztof Śmiałek 04e8b72908 Create "Unique" rule 2017-04-12 11:23:44 +02:00
Bruno Koga a0ba215524
Create "Pis" rule 2017-03-27 11:42:24 +02:00
Jonathan Stewmon 8851fb5abc
Always display message for AbstractRelated rule
`NestedValidationException` should include all `AbstractRelated` rule
exceptions.

`AbstractRelated` rule failures always indicate an interesting nested
context, which should not be omitted from the final result.

`NonOmissibleExceptionInterface` is a marker interface for
exceptions thrown by instances of `AbstractRelated`, which
facilitates identification of those rules' exceptions with
`instanceof`.
2017-03-27 10:21:45 +02:00
Henrique Moody 88e60b6a3a
Fix coding standard on PHPT file 2017-03-26 19:58:01 +02:00
Henrique Moody 2b8c560db4
Merge branch '1.1' 2017-03-14 10:46:47 +01:00
Henrique Moody 5ab87d1dd9
Merge branch '1.0' into 1.1 2017-03-14 10:44:11 +01:00
Henrique Moody dc869ac375
Only return "name" as is if it's a string 2017-03-14 10:28:03 +01:00
Henrique Moody b43c9b103b
Better message for Length rule
Update exception message when minimum value and maximum value are the
same.
2017-02-12 18:18:39 +01:00
Henrique Moody e708edd005
Rename rule "Numeric" to "NumericVal" 2016-11-06 18:45:44 +01:00
Henrique Moody 4d72af312f
Update PHP-CS-Fixer settings 2016-10-30 10:39:23 +01:00
Julián Gutiérrez 195a8fe534
Create "Nif" rule
Rule to validate spanish NIF (DNI/NIE/CIF).
2016-10-09 17:50:52 +02:00
Henrique Moody 08ea9b7925
Merge branch '1.1' 2016-09-20 08:45:34 +02:00
Henrique Moody e457f19dbd
Merge branch '1.0' into 1.1 2016-09-20 08:44:39 +02:00
Henrique Moody 98050476c6
Always return a valid exception
If calling the method `getExceptionForPath()` when the exception was
nested but had no child it was returning null. This commit ensures that
it always return a valid exception.
2016-09-19 18:22:39 +02:00
Tomasz Regdos 38aedd01e3
Create "Vatin" rule (VAT identification number)
See https://en.wikipedia.org/wiki/VAT_identification_number
2016-09-19 09:50:50 +02:00
Henrique Moody edf4e49ac6
Merge branch '1.0' into 1.1 2016-09-17 21:30:00 +02:00
Henrique Moody 4bcc4027f8
Try to use the getRelatedByName() method first
Then using the `findMessages()` method, tries to use the method
`getRelatedByName()` before using the `findRelated()` method.

This change was made because since on `KeyNested` rule you may have
names with '.' we'll never get the proper exception using
`findRelated()`.
2016-09-17 21:11:55 +02:00
Henrique Moody 98443bad0c
Get the proper exception when using findMessage() 2016-09-17 21:04:24 +02:00
Henrique Moody 494b67871f
Fix wrong behaviour on AbstractRelated
When you define the name for an `AbstractRelated` instance, you expect
that it also define the name for its child. But, when the child already
had a name the `AbstractRelated` was overwriting its name with the
`reference`.
2016-09-17 20:23:38 +02:00
Henrique Moody 6d0e3a2422
Merge branch '1.0' into 1.1 2016-09-13 11:32:43 +02:00
Henrique Moody 7e88a7a0c8
Always check the type then executing KeyNested 2016-09-12 18:06:10 +02:00
Henrique Moody cc179f9209 Merge branch '1.0' into 1.1 2016-08-03 10:53:00 +02:00
Henrique Moody e5fdd87a16 Rename "Iterable" to "IterableType" 2016-08-03 10:43:33 +02:00
Henrique Moody bb0e40a08e Set template for the only rule in the chain
When there is just one rule in the chain and the there is a defined
template for that, the expected behaviour when using the `check()`
method is to see the exception message with the defined template.
2016-04-08 13:39:57 -03:00
Henrique Moody 46541c7e46 Allow the define brands for credit card validation 2016-04-06 16:42:49 -03:00
Emmerson f40eb63d7b Create "PhpLabel" rule 2016-03-04 21:48:25 -03:00
Henrique Moody b1d0acc2e5 Fix some coding standards with php-cs-fixer 2016-03-04 21:42:27 -03:00
Henrique Moody c2eece6785 Create "IdentityCard" rule
Original-Author: Tomasz Regdos <tomek@regdos.com>.
2016-01-13 22:57:11 -02:00
Tomasz Regdos b8da3a947b Create "Pesel" rule
Create validator for PESEL - Polish Human Identification Number.
2015-12-17 11:25:57 -02:00
Guilherme Siani c828420438 Create "Image" rule 2015-12-14 10:14:26 -02:00
Emmerson eae8ccb72a Fix Age integration tests 2015-11-16 19:20:39 -03:00
William Espindola ecbc5c0a94 Create integration tests for "Age" role 2015-11-09 06:54:51 -02:00
William Espindola f2083a58d7 Create integration tests for "Bsn" rule 2015-11-09 06:54:43 -02:00
Kennedy Tedesco 7d8b18baca Making real tests for Exists rule 2015-11-04 15:52:19 -02:00
Andrew Peters 08a5ab0d81 Use "{less/greater} than or equal to" phrasing 2015-11-04 15:37:43 -02:00
Henrique Moody 59669e6403 Set timezone for tests that work with dates 2015-11-04 14:59:04 -02:00
Emmerson 621b4707b5 Create "LanguageCode" rule 2015-10-26 23:12:21 -03:00
Henrique Moody cd46545855 Small coding standards and docs improvements 2015-10-24 01:32:07 -02:00
Henrique Moody 474afaa2ec Remove "ValidationExceptionInterface" 2015-10-23 09:00:31 -02:00
Henrique Moody 67e072ebd3 Remove "NestedValidationExceptionInterface" 2015-10-23 09:00:18 -02:00
Diego Oliveira 70997912eb Create "Imei" rule 2015-10-23 07:53:59 -02:00
Alexandre Gaigalas 84fa389d4c Implements numeric Key/KeyNested Addressing
The Key and KeyNested rules didn't supported numeric
addressing (e.g. `v::key(42);`). This change implements it and
adds new tests for the behavior.
2015-10-22 10:35:58 -02:00
Henrique Moody 19698d6a38 Move rule integration tests do another directory 2015-10-22 03:22:58 -02:00
Henrique Moody 8c9c587597 Improvements and fixes on exceptions
There were some cases when the exceptions was not displayed property
when using nested exception, this commit fix the problem and also
display messages in Markdown list.
2015-10-22 03:01:41 -02:00
Edson Lima fd6fcd151e Create integration tests for "AllOf" rule 2015-10-21 10:27:22 -02:00
Henrique Moody 03c0bd03de Update message after changing exception properties 2015-10-21 04:14:11 -02:00
Emmerson 29bdb0a9f6 Create "BoolVal" rule 2015-10-21 01:35:05 -03:00
Edson Lima a281ad03d7 Create integration tests for "Consonant" rule 2015-10-21 01:02:19 -02:00
Henrique Moody e2b02b9777 Increase code coverage of rules 2015-10-19 14:17:47 -02:00
Danilo Correa 954c0ca133 Create integration tests for "Equals" rule 2015-10-18 19:11:58 -02:00
Guilherme Siani 1c254ab682 Refactor "ArrayVal" rule and add integration tests 2015-10-18 18:50:07 -02:00
João Torquato f08a1fa9fc Create "ArrayType" rule 2015-10-18 18:01:11 -02:00
Guilherme Siani 767fcaaccf Create "Iterable" rule 2015-10-18 17:27:25 -02:00
Reginaldo Junior 7398588c56 Create "FloatType" rule 2015-10-18 16:57:49 -02:00
Henrique Moody c84020f7f1 Set timezone for tests that work with dates 2015-10-18 16:22:46 -02:00
Justin Hook 4145faab39 Create "CurrencyCode" rule 2015-10-18 14:42:39 -02:00
João Torquato a3694241f2 Create "Countable" rule 2015-10-18 11:37:50 -02:00
Henrique Moody 9c49dd3bcf Use short array syntax 2015-10-17 22:56:32 -03:00
Rafael-BP 6fb15a697c Create integration tests for "ObjectType" rule 2015-10-17 22:25:35 -03:00
Felipe Martins cbbf082c15 Increase tests for "CountryCode" rule
- Add alpha-3 and numeric country codes and unit test for it
- Add new integration tests for CountryCode rule alpha-3 and numeric
2015-10-17 22:21:33 -03:00
Edson Lima 31f1f1c25e Create integration tests for "Beetween" rule 2015-10-17 22:16:01 -03:00
Edson Lima 16ad8f804d Create integration tests for "KeyValue" rule 2015-10-17 22:13:45 -03:00
Danilo Correa 5dc5410617 Crete integration tests for "BoolType" rule 2015-10-17 22:09:54 -03:00
Nawarian 85633cd8b0 Create integration tests for "Length" rule 2015-10-17 21:58:25 -03:00
Antonio Spinelli c6638b9ffb Create integration tests for "When" rule 2015-10-17 21:53:43 -03:00
William Espindola c289b44fe9 Improve integration tests for "Yes" rule 2015-10-17 21:33:40 -03:00
Henrique Moody 59fe72794d Remove integration tests for bank rule 2015-10-17 21:24:47 -03:00
Rogerio Prado de Jesus b1a86e6065 Create integration tests for "Bank" rule
Thanks @gabriercouto and @marcelgsantos for all the words about how to
make it, you guys are amazing :-D.
2015-10-17 18:16:42 -03:00
Gabriel Rodrigues Couto 3c75524cba Create integration tests for "Alpha" rule 2015-10-17 17:46:21 -03:00
Henrique Moody 87604434cf Fix typo on "callableType_4.phpt" test 2015-10-17 17:33:27 -03:00
Rafael-BP 94e552d60c Create integration tests for "CallableType" rule 2015-10-17 17:16:44 -03:00
Gabriel Rodrigues Couto d56905aeba Create Integration tests for "Numeric" rule 2015-10-17 17:10:47 -03:00
Reginaldo Junior 311bd1d762 Create integration tests for "CreditCard" rule 2015-10-17 17:06:18 -03:00
Danilo Correa 68b5cbe94a Create integration tests for "Digit" rule 2015-10-17 17:02:46 -03:00
Emmerson 21c2b4361e Creates integration tests for "Ip" rule 2015-10-17 17:00:11 -03:00
William Espindola 86f4822af3 Create integration test for "Bsn" rule 2015-10-17 16:54:10 -03:00
Marcel dos Santos 1e057c7687 Create integration tests for 'StringType' rule 2015-10-17 16:51:58 -03:00
Guilherme Siani fe17a2a6d8 Increase integration tests of "Alnum" rule
Created integration tests with extra functions of Alnum rule. Also
remove unecessary asserts from the AlnumTest.
2015-10-17 16:31:41 -03:00
Rafael-BP 4e894a7022 Create integration tests of "Optional" rule 2015-10-17 16:10:28 -03:00
Gabriel Rodrigues Couto 503143a90b Create integration tests for "NotEmpty" rule 2015-10-17 15:49:10 -03:00
Gabriel Rodrigues Couto 6ab3467d69 Create integration tests for "NullType" rule 2015-10-17 15:43:20 -03:00
Felipe Martins 08ce0fa455 Increase integration tests for "CountryCode" rule 2015-10-17 15:31:47 -03:00
Marcel dos Santos 669fd48e58 Create integration tests for "Slug" rule 2015-10-17 15:30:07 -03:00
Paulo Eduardo 0526c14cc9 Create integration tests for "Tld" rule 2015-10-17 15:26:09 -03:00
Guilherme Siani 780cedbec3 Created integration tests for "Alnum" rule 2015-10-17 15:22:08 -03:00
Rafael-BP e3a18c6665 Increase tests for "NotOptional" rule 2015-10-17 15:03:03 -03:00
João Torquato cbb0fa74a5 Create integration tests for "MinimumAge" rule 2015-10-17 15:01:21 -03:00
Danilo Correa 2aa368b8c8 Create integration tests from "CNPJ" rule 2015-10-17 14:43:56 -03:00
Gabriel Rodrigues Couto 142486bfcc Create integration tests for "NotBlank" rules 2015-10-17 14:26:58 -03:00
William Espindola ae1dfe6a66 Create integration test for "Yes" rule 2015-10-17 14:24:15 -03:00
Edson Lima 2f0db5ebff Create integration tests for "Email" rule 2015-10-17 14:18:33 -03:00
Henrique Moody ac8fb50400 Create integration tests from "CPF" rule 2015-10-17 12:40:39 -03:00
Henrique Moody 60568eac62 Create "IntType" rule 2015-10-16 23:43:01 -03:00
Henrique Moody d53811f7b7 Remove user-defined optional values
Since we have NotOptional rule now, we must keep the same opposite
behaviour between these two rules.

This commit also improve and increase tests from Optional rule and
updates the documentation.

No tests was made for messages on MODE_DEFAULT because it's not possible
for a while since we don't have such much granularity control, but after
some fixes on Not rule, maybe we will be able to do that, that's why I
kept the messages on OptionalException.
2015-10-15 11:14:20 -03:00
Henrique Moody 15b0a937b2 Create "NotOptional" rule 2015-10-15 10:36:48 -03:00
Henrique Moody 6f9a5771c2 Fix "Not" rule on first level 2015-10-14 13:56:29 -03:00
Henrique Moody 62761ffe18 Make all rules inclusive by default 2015-10-14 13:10:20 -03:00
Ivan Zinovyev 91e9c2053d Create "KeyNested" rule 2015-10-07 14:03:19 -03:00
Henrique Moody 255269bfb3 Rename rule "String" to "StringType" 2015-10-07 11:52:03 -03:00
Henrique Moody 9b85df4601 Rename rule "Int" to "IntVal" 2015-10-07 11:46:57 -03:00
Henrique Moody 937fa6b183 Create documentation for message localization
Also define the `translator` param to the related rules in
`AbstractNestedException`.
2015-10-07 10:18:31 -03:00
Henrique Moody 455ff9b318 Create "Optional" rule 2015-10-07 02:44:33 -03:00
Henrique Moody 62d8909928 Some small coding standard fixes 2015-09-11 02:59:11 -03:00
Henrique Moody 5a41a6bf0c Make exception messages simpler
When the exception has only one related exception, there is no need to
display it's messages unless it has an user-defined template.
2015-09-11 02:49:42 -03:00
Henrique Moody 69f433db6b Create method getMessages() on nested exception 2015-09-10 19:20:31 -03:00
Henrique Moody 748b280c34 Update conversion to strings on exceptions
Many changes were made on `ValidationException::stringify`:
- Add support for instances of `Exception`;
- Add support for instances of `Traversable`;
- Add support for resources;
- Improve `Array` conversion;
- Improve `Object` conversion;
- Improve conversion of all values by using JSON.

Now, all the parameters of the exception classes are just converted to
string when replacing parameters on exceptions, so the exception classes
now keep the original value of all parameters.
2015-09-04 17:11:40 -03:00
Henrique Moody c4e6f0875e Create test for Not rule with recursion 2015-09-04 15:24:03 -03:00
Henrique Moody 743fafb31b Create PHPT tests from AbstractNestedExceptionTest 2015-07-29 17:08:06 -03:00
Henrique Moody 4037209302 Move some tests from ValidatorTest to PHPT files
- setTemplate() with single validator should use template as main
  message
- setTemplate() with multiple validators should use template as main
  message
- setTemplate() with multiple validators should use template as full
  message
- getFullMessage() should include all validation messages in a chain
- not() should work by builder
- countryCode()
- alwaysValid()
- alwaysInvalid()
- Issue #85: findMessages() should not trigger catchable fatal error
- keys as validator names
- Do not rely on nested validation exception interface for check
2015-07-29 01:19:00 -03:00