Commit graph

20 commits

Author SHA1 Message Date
Henrique Moody 2ee7509c2e
Make data providers static
From PHPUnit 10, all data providers need to be static. This commit will
make migrating from version 9 to 10 a bit easier.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2023-04-03 17:20:31 +02:00
Alexandre Gomes Gaigalas ab3732f91f Use SPDX IDs for licensing
SPDX IDs are shorter than licensing notes previously used, and
adhere better to FOSS standards. It is also machine-readable.
2023-02-19 00:19:10 -03:00
Alexandre Gomes Gaigalas 15f148da24 Dusting off. See CHANGELOG.md for more details on this commit 2023-02-13 03:59:11 -03:00
Henrique Moody ef8a8f4b27
Turn LICENSE file into plain/text
There is no need for that file to be a Markdown, and it can be a plain
text file.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-23 16:21:34 +02:00
Henrique Moody 2ac0aecf0c
Fix some issues with the "KeyValue" rule
There are a couple of issues with the "KeyValue" rule:

* When using it with "Not" it does not fetch the exception from the rule
  that it creates during the validation.

* It creates a "Validator" rule, which means that it creates two rules
  (Validator and the real rule) every time it validates an input.

This commit will fix these two issues and also create integration tests
that will ensure its behavior in case of change.

Co-authored-by: Danilo Correa <danilosilva87@gmail.com>
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-04-23 19:55:13 +02:00
Henrique Moody b340b74cfd
Make classes final
The rules "AllOf," "NotEmpty," and "Xdigit" cannot be final because
other rules extend them.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-17 20:13:27 +01:00
Henrique Moody 688fbde552
Make PHPUnit tests final
Whenever is possible it is better to declare our classes as final. The
PHPUnit tests should not be extended, therefore there is no reason for
them to not be final.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:32:12 +01:00
Henrique Moody ab87cb083d
Merge branch '1.1' 2018-12-05 08:57:05 +01:00
Henrique Moody 66f5475463
Update PHP support
Due to the current status of the development of the library, it seems
like we will be supporting version 1.1 for a long time. Even when we
release version 2.0 we will still give support for version 1.1 for a
while.

This commit will make sure that version 1.1 is fully supported for PHP
7.2 and 7.3. Also, it will remove the support for HHVM since it will not
keep the compatibility with PHP anymore [1].

In order to make that happen, this commit will create a TestCase from
Validation so we can use the same API to create mocks in both PHPUnit
versions 4.0 and 5.0.

During the development of this commit, I noticed that PHPUnit 4.0 had
issues to mock "SplFileInfo" and for that reason, this commit will also
replace those mocks by "SplFileInfo" instances.

[1]: https://hhvm.com/blog/2018/09/12/end-of-php-support-future-of-hack.html

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-12-02 11:09:24 +01:00
Henrique Moody 9e7571fb98
Add missing "@author" annotations
This commit will make sure that every class, interface, or trait will
have the "@author" annotation in it.

In order to create a list of authors, I used the "git blame" command,
which means that if someone changed or even created the file but does
not have any remaining line will not be shown in the list; it's a
trade-off worth but it is worth it. The other way to do it would be
carefully checking each file.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-11-25 18:08:44 +01:00
Henrique Moody e044e4b16e
Add some code standards for PHPUnit tests
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-07-23 20:46:18 +02: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 30dc089565
Method check() 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 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 fa030637cc
Fix wrong call to PHPUnit assertions
The assertion methods are all static, therefore they should be called
with self::assert* instead of $this->assert*.
2017-11-12 14:35:19 +01:00
Gabriel Caruso 93ce9cb93a
Updated to PHPUnit 6 2017-11-12 14:22:22 +01:00
Ian d65e713080
Improve grammar of "Equals" rule 2017-10-15 18:27:36 +02:00
Henrique Moody d67394cd39
Escape fully qualified class names 2017-02-04 14:01:14 +01:00
Henrique Moody 9c49dd3bcf Use short array syntax 2015-10-17 22:56:32 -03:00
Henrique Moody 5a9f1fe508 Create "KeyValue" rule 2015-10-13 07:37:12 -03:00