Commit graph

7 commits

Author SHA1 Message Date
Henrique Moody 02a1923eb5 Move unit tests to "tests/unit" 2015-08-11 13:36:25 -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
Henrique Moody a3c945aa51 Add license information and copyright in all files 2015-06-08 12:09:25 -03:00
Henrique Moody b8c76e3054 Fix some coding standards 2015-06-08 11:51:45 -03:00
Andy Wendt ab65035181 Issue #260: Now using Respect\Validation exceptions only
* `ExceptionInterface`: all Respect\Validation\Exceptions implement through inheritance
* `ValidatorExceptionInterface`: implemented only by AllOfException.  This allows the end users to know when there has been a Validator exception rather than just any of our exceptions.

Fixed formatting issues

Created two new exception types

* Created ValidationExceptionInterface
* Created NestedValidationExceptionInterface which extends ValidationExceptionInterface
    * Renamed from ValidatorExceptionInterface

* ValidationException implements ValidationExceptionInterface and ValidationExceptionTest checks for the implementation.
* AbstractNestedException implements NestedValidationExceptionInterface and AbstractNestedExceptionTest checks for the implementation.

* CheckExceptionsTest now checks all Rule exceptions to make sure they implement ValidationExceptionInterface
* ValidatorTest now contains test that shows that only ValidationExceptionInterface can be used reliably with `::check()`

* Updated documentation for new exception types
* Reworked examples to show how to catch the exception interfaces

Minor changes in readme.md and ExceptionInterfaces

* Removed `import` statements (hahaha)
* Renamed `$e` to `$exception`

* `ValidationExceptionInterface` now extends `ExceptionInterface`.  Changed `ValidationException` to match
2015-01-31 07:59:59 -07:00
Henrique Moody 57d82ce029 Merge branch '0.7' 2015-01-19 21:09:47 -02:00
Henrique Moody eb3b8313aa Move tests files 2015-01-19 11:01:00 -02:00
Renamed from tests/library/Respect/Validation/ValidatorTest.php (Browse further)