Commit graph

266 commits

Author SHA1 Message Date
Alexandre Gaigalas
a8d1c94962 Remove support for undocumented baseXX() shortcut
Previously undocumented, this feature is now removed to improve
each chain call.
2015-01-14 19:27:06 -02:00
Alexandre Gaigalas
ecd2cc9931 Update PrntTest to use chr() as provider argument
On Windows machines, \t produces a pritable character, thus making
the tests incompatible between systems.
2015-01-14 19:23:52 -02:00
Henrique Moody
2b97bbba22 Update PHPUnit settings
- Move "tests/phpunit.xml" to "phpunit.xml.dist"
- Update documentation and contributing documents
- Update Travis settings
- Add "phpunit.xml" in the Git ignore list
2015-01-07 16:02:58 -02:00
Henrique Moody
b5d3ff63ee Create Yes/No rules 2015-01-06 20:46:16 -02:00
davidepastore
960732d26c Create HexRgbColor rule 2015-01-06 13:42:53 -02:00
Henrique Moody
3e89ee385f Always define names for children in composite rules 2015-01-05 12:47:32 -02:00
Henrique Moody
ba064eb400 Merge pull request #231 from henriquemoody/setName
Define names for children in composite rules
2015-01-03 14:40:28 -02:00
Henrique Moody
e836b22210 Define names for children in composite rules 2015-01-03 14:18:20 -02:00
Róbert Nagy
14d65f47ea Allow support for IDN with subdomains
I just moved the IDN rule from checks array to otherParts validation,
because the old approach did not supported an IDN with subdomain.
2015-01-03 12:29:52 -02:00
Henrique Moody
0ffd74f7bb Merge pull request #183 from henriquemoody/callback
Allow to define arguments of callback
2015-01-02 19:18:25 -02:00
Henrique Moody
02b9417473 Merge pull request #226 from henriquemoody/postalcode
Create PostalCode rule
2015-01-02 19:08:55 -02:00
Henrique Moody
df8f10f4ea Create PostalCode rule
Thanks @xthiago (Thiago Rodrigues) for the initial idea.
2015-01-02 18:56:34 -02:00
Henrique Moody
2cfc96003d Add missing exceptions
Also creates a test to check it every rule has an exception.
2015-01-02 17:25:01 -02:00
Henrique Moody
0171f02c2c Merge pull request #207 from henriquemoody/Executable
Create Executable rule
2015-01-02 16:44:14 -02:00
Henrique Moody
e2950e6a51 Create Executable rule 2014-11-10 16:36:12 -02:00
Henrique Moody
64d069fd5b Allow to define arguments of callback 2014-11-10 16:34:08 -02:00
romeo
2ee85d801b Fixed test. 2014-10-17 22:22:12 +04:00
romeo
e5deb5f72a Added test PR #214. 2014-10-17 22:09:25 +04:00
romeo
909b242124 Added test PR #214. 2014-10-17 21:56:52 +04:00
Wesley Victhor Mendes Santiago
6ee3c40ab6 Merge pull request #210 from osiux/issue-187
7 digits phone numbers should be valid.
2014-10-06 19:04:28 -03:00
Eduardo Reveles
00940cfee9 Translate date formats to something DateTime::createFromFormat can understand. 2014-10-01 01:09:27 -05:00
Eduardo Reveles
f1777de330 7 digits phone numbers should be valid. 2014-10-01 00:36:28 -05:00
Alexandre Gaigalas
0ca64fa83b Fixing tests/bootstrap.php for #182 2014-07-14 11:04:38 -03:00
Henrique Oliveira
c84d9a21a9 Fixed Phone Ninth digit validation for Brazilian phone numbers 2014-04-26 23:32:56 -03:00
Augusto Pascutti
979c06997b Merge pull request #148 from augustohp/develop
Allow internationalized domains and skip TLD check.
2014-02-19 23:20:33 -03:00
Augusto Pascutti
9acc778a8c Merge pull request #151 from leonnleite/develop
Add missing CNPJException
2014-02-19 23:01:38 -03:00
root
61f8cc25ae updating tests to testing when the missing cnpjException file 2014-02-19 22:34:01 -03:00
Mehmet Tolga Avcioglu
d12787cb9e Domain rules now can skip TLD checks and accepts IDNA.
Skipping TLD check allows for local domains like "machine.dev",
but the default behavior of the rule still the same: it validates
TLDs, so domains will only be valid (by default) if the TLD is a
valid one.

The signature of rule (using the builder) changes from:

    v::domain() // Still works, same behavior as before.

To:

    v::domain(false) // Skips TLD check.

Fix #33.

The "Domain" rule now validates domains on "ASCII Compatible Encoding"
[ACE][1] for internationalized domain names (ICANN, 2003).

An excerpt from Wikipedia article:

> If given a label containing at least one non-ASCII character, ToASCII
> will apply the Nameprep algorithm, which converts the label to
> lowercase and performs other normalization, and will then translate the
> result to ASCII using [Punycode][16] before prepending the four-character
> string ["xn--"][17].

[1]: http://wikipedia.org/wiki/Internationalized_domain_name#ToASCII_and_ToUnicode
[16]: http://tools.ietf.org/html/rfc3492
[17]: http://www.atm.tut.fi/list-archive/ietf-announce/msg13572.html
2014-02-16 21:29:23 -03:00
Augusto Pascutti
87397f9125 Merge pull request #146 from augustohp/139-Broken_sf_rule
Fix 139: Broken `sf` (Symfony) rule
2014-02-16 18:30:09 -03:00
Andrey Knupp Vital
917176222c Adds NFeAccessKey validation rule.
Relevant just to Brazil, this rule validates NFe access key.
2014-02-16 16:48:51 -03:00
Augusto Pascutti
c2850055bc Fix Symfony validation rule.
The API of Symfony\Component\Validator changed more than 2 years ago, so
this validation rule wasn't working for quite a long time.

This fixes the validator to work with versions >= 2.1 of
Symfony/Validation as the change on composer shows us. Although a bug
fix, this breaks compatibility with people already using this validator.

I was astonished to not find any tests for that validator also. :(
With those tests we can ensure that any change on the component API will
be noticed by us.
2014-02-16 03:22:41 -03:00
Augusto Pascutti
d2ca4b5d56 Skip instead of fail if Zend/Validator is not present.
It makes more sense to skip a test that can't be executed than failing
indicating a problem with the test suite.
2013-12-10 00:50:32 -02:00
nickl-
b94e235474 Updated bootstrap as per changes to composer. 2013-07-03 03:26:28 +02:00
nickl-
e68325cea5 Playing with travis 2013-07-03 02:46:17 +02:00
mf
137fc4766b Adding missing files 2013-04-28 23:35:29 -04:00
Pascal Borreli
2776a405cb Fixed typos 2013-02-25 23:15:23 +00:00
nickl-
9be0ee8aac Complete additionalChars tests as per Alnum see #114 2013-02-22 20:53:28 +02:00
Henrique Moody
3f41cf6058 Created rule "Uploaded"
This rule checks if the given data is a file was uploaded via HTTP POST.
2013-02-04 22:57:35 -02:00
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