Commit graph

17 commits

Author SHA1 Message Date
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
fd2bae7352
Enforce the use of "@covers" annotation
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-07-23 21:37:38 +02: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
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
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
Henrique Moody
6f5c623926
Use class constant instead of FQCN 2016-10-30 20:16:13 +01:00
Henrique Moody
f34a34c0b2
Always use mbstring functions 2016-10-30 10:45:30 +01:00
Henrique Moody
fb471f9667 Remove deprecated "Iterable" rule 2016-08-03 11:08:22 +02:00
Henrique Moody
e5fdd87a16 Rename "Iterable" to "IterableType" 2016-08-03 10:43:33 +02:00
Henrique Moody
474afaa2ec Remove "ValidationExceptionInterface" 2015-10-23 09:00:31 -02:00
Henrique Moody
9c49dd3bcf Use short array syntax 2015-10-17 22:56:32 -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
Renamed from tests/Exceptions/CheckExceptionsTest.php (Browse further)