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
Emmerson
29bdb0a9f6
Create "BoolVal" rule
2015-10-21 01:35:05 -03:00
Henrique Moody
e2b02b9777
Increase code coverage of rules
2015-10-19 14:17:47 -02:00
Emmerson
dddad80f48
Improvements on JSON rule
2015-10-19 11:57:42 -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
f0d249346f
Complete tests for "AbstractRule" class
2015-10-18 16:22:43 -02:00
Henrique Moody
4964d561c4
Rename namespace of *TestCase classes
2015-10-18 14:50:59 -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
Antonio Spinelli
b4a9253a03
Create RuleTestCase
...
It is a abstract test class to provide simple way to test rules and
create a mock rule.
2015-10-17 21:53:03 -03:00
Nawarian
ffd199d2b0
Refactoring unit tests of "Contains" rule
2015-10-17 16:48:17 -03:00
Felipe Martins
141103f085
Improve "CountryCode" rule
...
Add "alpha-3" and "numeric" country codes and unit test for it.
2015-10-17 16:42:43 -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
Emmerson
24a65d712b
Refactor tests of "Cnpj" rule
2015-10-17 16:04:59 -03:00
Alexandre Gaigalas
9c03380f24
Adds partial test suite for AbstractRule
2015-10-17 16:02:12 -03:00
Marcel dos Santos
8e6b5f5834
Refactor unit tests for "StringType" rule
2015-10-17 15:45:11 -03:00
Nawarian Nickolas
b8f2f03289
Refactor tests of "Length" rule
2015-10-17 15:09:48 -03:00
Paulo Eduardo
aa13468d04
Refactor test of "Bsn" rule
...
- Remove Dead Code
- Increase Code Coverage
2015-10-17 14:20:45 -03:00
Marcel dos Santos
c9bd83f111
Refactor unit tests for "Slug" rule
2015-10-17 14:11:54 -03:00
Paulo Eduardo
2ac90907e7
Create unit tests for "AlwaysValid" rule
2015-10-17 14:03:03 -03:00
Felipe Martins
a30b730969
Add unit test for "CountryCode" rule
2015-10-17 13:58:25 -03:00
Paulo Eduardo
196ab887e5
Add unit tests for "Tld" rule
2015-10-17 13:55:25 -03:00
Alexandre Gaigalas
a0e4cfa1e2
Fixes MimeTypeTest Expected Exception Path
...
Previously, the MimeTypeTest was matching UNIX-style file slashes
in its PHPUnit Expected Exception. This change fixes it to
ignore the slash and match only the file name and pass on Windows
platforms as well.
2015-10-17 11:17:32 -03:00
Henrique Moody
60568eac62
Create "IntType" rule
2015-10-16 23:43:01 -03:00
Ronald Drenth
8cab57052e
Create "Bsn" rule
2015-10-16 22:19:33 +02: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
bbf9c2505e
Remove all rules shortcuts
2015-10-14 13:06:36 -03:00
Henrique Moody
880cdb5f09
Create "NotBlank" rule
2015-10-14 01:05:42 -03:00
Henrique Moody
b28e97c70f
Create "Identical" rule
2015-10-13 13:29:34 -03:00
Henrique Moody
641b169c1b
Remove identical checking from "Equals" rule
2015-10-13 13:29:31 -03:00
Henrique Moody
5a9f1fe508
Create "KeyValue" rule
2015-10-13 07:37:12 -03:00
Ivan Zinovyev
91e9c2053d
Create "KeyNested" rule
2015-10-07 14:03:19 -03:00
Henrique Moody
1931da7570
Rename rule "Scalar" to "ScalarVal"
2015-10-07 12:44:20 -03:00
Henrique Moody
88865267d9
Rename rule "Resource" to "ResourceType"
2015-10-07 12:44:19 -03:00
Henrique Moody
598bfa2843
Rename rule "Object" to "ObjectType"
2015-10-07 12:44:19 -03:00
Henrique Moody
5941c2ce50
Rename rule "NullValue" to "NullType"
2015-10-07 12:44:13 -03:00
Henrique Moody
5863903e48
Rename rule "Arr" to "ArrayVal"
2015-10-07 12:25:15 -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
3e1f86baf8
Rename rule "Float" to "FloatVal"
2015-10-07 11:42:37 -03:00
Henrique Moody
7f2cdceb31
Rename rule "True" to "TrueVal"
2015-10-07 11:38:24 -03:00
Henrique Moody
fef01d7e09
Rename rule "False" to "FalseVal"
2015-10-07 11:36:31 -03:00
Henrique Moody
0ae5d25de7
Rename rule "Bool" to "BoolType"
2015-10-07 11:30:29 -03:00
Henrique Moody
455ff9b318
Create "Optional" rule
2015-10-07 02:44:33 -03:00
Henrique Moody
3e45647b81
Make all rules mandatory
2015-10-07 01:00:39 -03:00
Henrique Moody
3fbc45d44f
Add country code to postal code exception message
2015-09-24 00:49:25 -03:00
Henrique Moody
9ab672d489
Fix bugs on "SubdivisionCode" rule
...
The last commit was a cherry-pick from a long time ago, so the test was
into a different repository which could not be seen by PHPUnit. I moved
the tests and them I could see that the rule had some bugs and wrong
exception messages.
2015-09-22 10:08:17 -03:00
Ricardo Gobbo
a026124590
Create "VideoUrl" rule
2015-09-15 23:41:24 -03:00
Henrique Moody
13454e3f6a
Use filter_var()
on "True" and "False" rules
2015-09-11 14:20:46 -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
David Meister
f14e53921c
Create "Factor" rule
2015-09-10 13:44:00 -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
8faed71a05
The finfo::file() accepts only valid files
2015-08-26 19:46:51 -03:00
Henrique Moody
77b046f907
Create "CallableType" rule
2015-08-20 01:29:00 -03:00
Henrique Moody
ea71de5812
Create "Scalar" rule
2015-08-20 01:28:59 -03:00
Henrique Moody
954c257fc9
Create "Resource" rule
2015-08-20 01:28:59 -03:00
Henrique Moody
a7aa5f8ec0
Create "Infinite" rule
2015-08-20 01:28:59 -03:00
Henrique Moody
c80ed1bb85
Create "Finite" rule
2015-08-20 01:28:56 -03:00
Henrique Moody
75b406c240
Missing @group rule
on locale rules
2015-08-16 15:07:15 -03:00
Henrique Moody
757c3776af
Add @covers
and @group rule
on rule tests
2015-08-16 15:00:05 -03:00
Andy Wendt
007e37b570
Removed all deprecated rules
...
Also their exceptions and tests. Removed the class names from the
`$deprecateds[]` in `CheckExceptionsTest`.
2015-08-13 04:40:17 -03:00
Henrique Moody
02a1923eb5
Move unit tests to "tests/unit"
2015-08-11 13:36:25 -03:00