From 47f4a149a69f10e42bf0fd5da176121e7e3b4793 Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 28 Mar 2019 11:32:46 +0000 Subject: [PATCH 1/5] Bumped test suite to Laravel 5.5 and PHP 7.0+ (#11) * Bumped test suite to Laravel 5.5 and PHP 7.0+ * Updated tests to PHPUnit 6 * Removed bad phpunit attributes --- .travis.yml | 5 ++-- phpunit.xml.dist | 2 +- tests/Facades/JsVaidatorFacadeTest.php | 4 +-- tests/Javascript/JavascriptRulesTraitTest.php | 4 +-- tests/Javascript/JavascriptValidatorTest.php | 4 +-- tests/Javascript/MessageParserTest.php | 4 +-- tests/Javascript/RuleParserTest.php | 4 +-- tests/Javascript/ValidatorHandlerTest.php | 4 +-- tests/JsValidationServiceProviderTest.php | 4 +-- tests/JsValidatorFactoryTest.php | 4 +-- tests/Remote/ResolverTest.php | 4 +-- tests/Remote/ValidatorTest.php | 4 +-- tests/RemoteValidationMiddlewareTest.php | 4 +-- tests/Support/AccessProtectedTraitTest.php | 4 +-- tests/Support/DelegatedValidatorTest.php | 4 +-- tests/Support/RuleListTraitTest.php | 4 +-- .../UseDelegatedValidatorTraitTest.php | 4 +-- tests/composer-5.4.json | 26 ------------------- tests/composer-5.5.json | 26 +++++++++++++++++++ 19 files changed, 60 insertions(+), 59 deletions(-) delete mode 100644 tests/composer-5.4.json create mode 100644 tests/composer-5.5.json diff --git a/.travis.yml b/.travis.yml index 5e3db6b7..ea071147 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,13 +3,14 @@ language: php sudo: false php: - - 5.6 - 7.0 - 7.1 + - 7.2 + - 7.3 env: matrix: - - LARAVEL=5.4 + - LARAVEL=5.5 before_script: - export COMPOSER=tests/composer-$LARAVEL.json diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5e0d9663..abf6b3a1 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -22,7 +22,7 @@ - + diff --git a/tests/Facades/JsVaidatorFacadeTest.php b/tests/Facades/JsVaidatorFacadeTest.php index a11940bb..5b3d31fe 100644 --- a/tests/Facades/JsVaidatorFacadeTest.php +++ b/tests/Facades/JsVaidatorFacadeTest.php @@ -3,10 +3,10 @@ namespace Proengsoft\JsValidation\Test\Facades; use Mockery as m; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Facades\JsValidatorFacade; -class JsValidatorFacadeTest extends PHPUnit_Framework_TestCase { +class JsValidatorFacadeTest extends TestCase { /** * Calls Mockery::close diff --git a/tests/Javascript/JavascriptRulesTraitTest.php b/tests/Javascript/JavascriptRulesTraitTest.php index 2de52a14..1662cf15 100644 --- a/tests/Javascript/JavascriptRulesTraitTest.php +++ b/tests/Javascript/JavascriptRulesTraitTest.php @@ -2,9 +2,9 @@ namespace Proengsoft\JsValidation\Tests\Javascript; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class JavascriptRulesTraitTest extends PHPUnit_Framework_TestCase +class JavascriptRulesTraitTest extends TestCase { protected $mockTrait; diff --git a/tests/Javascript/JavascriptValidatorTest.php b/tests/Javascript/JavascriptValidatorTest.php index 723e8cdc..628fe2cc 100644 --- a/tests/Javascript/JavascriptValidatorTest.php +++ b/tests/Javascript/JavascriptValidatorTest.php @@ -4,12 +4,12 @@ use Illuminate\Support\Facades\View; use Mockery as m; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Exceptions\PropertyNotFoundException; use Proengsoft\JsValidation\Javascript\JavascriptValidator; use Proengsoft\JsValidation\Javascript\ValidatorHandler; -class JavascriptValidatorTest extends PHPUnit_Framework_TestCase +class JavascriptValidatorTest extends TestCase { public function setUp() { diff --git a/tests/Javascript/MessageParserTest.php b/tests/Javascript/MessageParserTest.php index fcbf932c..30493a28 100644 --- a/tests/Javascript/MessageParserTest.php +++ b/tests/Javascript/MessageParserTest.php @@ -2,10 +2,10 @@ namespace Proengsoft\JsValidation\Tests\Javascript; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Javascript\MessageParser; -class MessageParserTest extends PHPUnit_Framework_TestCase +class MessageParserTest extends TestCase { public function testGetMessage() { diff --git a/tests/Javascript/RuleParserTest.php b/tests/Javascript/RuleParserTest.php index b0534307..f65e4f93 100644 --- a/tests/Javascript/RuleParserTest.php +++ b/tests/Javascript/RuleParserTest.php @@ -2,10 +2,10 @@ namespace Proengsoft\JsValidation\Tests\Javascript; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Javascript\RuleParser; -class RuleParserTest extends PHPUnit_Framework_TestCase +class RuleParserTest extends TestCase { public function testGetClientRule() { diff --git a/tests/Javascript/ValidatorHandlerTest.php b/tests/Javascript/ValidatorHandlerTest.php index 5421f0e6..583ce523 100644 --- a/tests/Javascript/ValidatorHandlerTest.php +++ b/tests/Javascript/ValidatorHandlerTest.php @@ -2,11 +2,11 @@ namespace Proengsoft\JsValidation\Tests\Javascript; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Javascript\RuleParser; use Proengsoft\JsValidation\Javascript\ValidatorHandler; -class ValidatorHandlerTest extends PHPUnit_Framework_TestCase +class ValidatorHandlerTest extends TestCase { public function testValidationData() { diff --git a/tests/JsValidationServiceProviderTest.php b/tests/JsValidationServiceProviderTest.php index f6b0a2c4..ace402a6 100644 --- a/tests/JsValidationServiceProviderTest.php +++ b/tests/JsValidationServiceProviderTest.php @@ -2,9 +2,9 @@ namespace Proengsoft\JsValidation\Tests; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class JsValidationServiceProviderTest extends PHPUnit_Framework_TestCase +class JsValidationServiceProviderTest extends TestCase { protected function getMockedService($app) { diff --git a/tests/JsValidatorFactoryTest.php b/tests/JsValidatorFactoryTest.php index 16b4c0fa..48021566 100644 --- a/tests/JsValidatorFactoryTest.php +++ b/tests/JsValidatorFactoryTest.php @@ -3,12 +3,12 @@ namespace Proengsoft\JsValidation\Tests; use Mockery as m; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\JsValidatorFactory; require_once __DIR__.'/stubs/JsValidatorFactoryTest.php'; -class JsValidatorFactoryTest extends PHPUnit_Framework_TestCase +class JsValidatorFactoryTest extends TestCase { protected function mockedApp($rules, $messages, $customAttributes, $data = []) { diff --git a/tests/Remote/ResolverTest.php b/tests/Remote/ResolverTest.php index 47c43e52..c2c40664 100644 --- a/tests/Remote/ResolverTest.php +++ b/tests/Remote/ResolverTest.php @@ -3,12 +3,12 @@ namespace Proengsoft\JsValidation\Tests\Remote; use Illuminate\Http\Exceptions\HttpResponseException; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Remote\Resolver; require_once __DIR__.'/../stubs/ResolverTest.php'; -class ResolverTest extends PHPUnit_Framework_TestCase +class ResolverTest extends TestCase { public function setUp() { diff --git a/tests/Remote/ValidatorTest.php b/tests/Remote/ValidatorTest.php index ab487532..46f0c46e 100644 --- a/tests/Remote/ValidatorTest.php +++ b/tests/Remote/ValidatorTest.php @@ -7,14 +7,14 @@ use Illuminate\Translation\Translator; use Illuminate\Validation\ValidationException; use Illuminate\Validation\Validator as LaravelValidator; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Javascript\ValidatorHandler; use Proengsoft\JsValidation\Remote\Validator; use Symfony\Component\Translation\Loader\ArrayLoader as SymfonyArrayLoader; use Symfony\Component\Translation\MessageSelector; use Symfony\Component\Translation\Translator as SymfonyTranslator; -class ValidatorTest extends PHPUnit_Framework_TestCase +class ValidatorTest extends TestCase { public function testValidateRemoteRulePasses() { diff --git a/tests/RemoteValidationMiddlewareTest.php b/tests/RemoteValidationMiddlewareTest.php index d12c2441..063b1c53 100644 --- a/tests/RemoteValidationMiddlewareTest.php +++ b/tests/RemoteValidationMiddlewareTest.php @@ -2,11 +2,11 @@ namespace Proengsoft\JsValidation\Tests; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Proengsoft\JsValidation\Remote\Validator; use Proengsoft\JsValidation\RemoteValidationMiddleware; -class RemoteValidationMiddlewareTest extends PHPUnit_Framework_TestCase +class RemoteValidationMiddlewareTest extends TestCase { public function setUp() { diff --git a/tests/Support/AccessProtectedTraitTest.php b/tests/Support/AccessProtectedTraitTest.php index 2964828b..70f40c52 100644 --- a/tests/Support/AccessProtectedTraitTest.php +++ b/tests/Support/AccessProtectedTraitTest.php @@ -2,7 +2,7 @@ namespace Proengsoft\JsValidation\Support; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; class ProtectedClassStubTest { @@ -14,7 +14,7 @@ protected function protectedMethod() } } -class AccessProtectedTraitTest extends PHPUnit_Framework_TestCase +class AccessProtectedTraitTest extends TestCase { private $mockTrait; private $stubInstance; diff --git a/tests/Support/DelegatedValidatorTest.php b/tests/Support/DelegatedValidatorTest.php index dab6376d..4611366f 100644 --- a/tests/Support/DelegatedValidatorTest.php +++ b/tests/Support/DelegatedValidatorTest.php @@ -2,9 +2,9 @@ namespace Proengsoft\JsValidation\Support; //use Proengsoft\JsValidation\Support\DelegatedValidator; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class DelegatedValidatorTest extends PHPUnit_Framework_TestCase +class DelegatedValidatorTest extends TestCase { /** * Test getValidator method diff --git a/tests/Support/RuleListTraitTest.php b/tests/Support/RuleListTraitTest.php index b3038c07..0a3dc319 100644 --- a/tests/Support/RuleListTraitTest.php +++ b/tests/Support/RuleListTraitTest.php @@ -2,9 +2,9 @@ namespace Proengsoft\JsValidation\Support; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class RuleListTraitTest extends PHPUnit_Framework_TestCase +class RuleListTraitTest extends TestCase { private $mockTrait; diff --git a/tests/Support/UseDelegatedValidatorTraitTest.php b/tests/Support/UseDelegatedValidatorTraitTest.php index acf8f3a4..438757a9 100644 --- a/tests/Support/UseDelegatedValidatorTraitTest.php +++ b/tests/Support/UseDelegatedValidatorTraitTest.php @@ -2,9 +2,9 @@ namespace Proengsoft\JsValidation\Support; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class UseDelegatedValidatorTraitTest extends PHPUnit_Framework_TestCase +class UseDelegatedValidatorTraitTest extends TestCase { public function testGetterAndSetter() { diff --git a/tests/composer-5.4.json b/tests/composer-5.4.json deleted file mode 100644 index 10c4649e..00000000 --- a/tests/composer-5.4.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "require": { - "php": ">=5.6.4", - "illuminate/support": "5.4.*", - "illuminate/validation": "5.4.*", - "illuminate/contracts": "5.4.*", - "illuminate/view": "5.4.*", - "illuminate/config": "5.4.*", - "illuminate/http": "5.4.*", - "illuminate/translation": "5.4.*" - }, - "require-dev": { - "phpunit/phpunit": "^5.7", - "mockery/mockery": "^0.9.8" - }, - "autoload": { - "psr-4": { - "Proengsoft\\JsValidation\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Proengsoft\\JsValidation\\Tests\\": "tests" - } - } -} diff --git a/tests/composer-5.5.json b/tests/composer-5.5.json new file mode 100644 index 00000000..fe8024ec --- /dev/null +++ b/tests/composer-5.5.json @@ -0,0 +1,26 @@ +{ + "require": { + "php": ">=7.0.8", + "illuminate/support": "5.5.*", + "illuminate/validation": "5.5.*", + "illuminate/contracts": "5.5.*", + "illuminate/view": "5.5.*", + "illuminate/config": "5.5.*", + "illuminate/http": "5.5.*", + "illuminate/translation": "5.5.*" + }, + "require-dev": { + "phpunit/phpunit": "~6.0", + "mockery/mockery": "^0.9.8" + }, + "autoload": { + "psr-4": { + "Proengsoft\\JsValidation\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Proengsoft\\JsValidation\\Tests\\": "tests" + } + } +} From c96bbd4917abe4b8151f3e2692ec1eae39f06d59 Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Tue, 5 Nov 2019 12:38:50 +0000 Subject: [PATCH 2/5] updated tests --- .travis.yml | 31 ++++++++++++++++++++++++++- phpunit.xml.dist | 2 +- tests/autoload.php | 47 +++++++++++++++++++++++++++++++++++++++++ tests/composer-5.4.json | 26 +++++++++++++++++++++++ tests/composer-5.6.json | 26 +++++++++++++++++++++++ tests/composer-5.7.json | 26 +++++++++++++++++++++++ tests/composer-5.8.json | 26 +++++++++++++++++++++++ tests/composer-6.0.json | 26 +++++++++++++++++++++++ 8 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 tests/autoload.php create mode 100644 tests/composer-5.4.json create mode 100644 tests/composer-5.6.json create mode 100644 tests/composer-5.7.json create mode 100644 tests/composer-5.8.json create mode 100644 tests/composer-6.0.json diff --git a/.travis.yml b/.travis.yml index ea071147..be0b4b7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php sudo: false php: + - 5.6 - 7.0 - 7.1 - 7.2 @@ -10,7 +11,35 @@ php: env: matrix: - - LARAVEL=5.5 + - LARAVEL=5.4 + - LARAVEL=5.5 + - LARAVEL=5.6 + - LARAVEL=5.7 + - LARAVEL=5.8 + - LARAVEL=6.0 + +matrix: + exclude: + - php: 5.6 + env: LARAVEL=5.5 + - php: 5.6 + env: LARAVEL=5.6 + - php: 5.6 + env: LARAVEL=5.7 + - php: 5.6 + env: LARAVEL=5.8 + - php: 5.6 + env: LARAVEL=6.0 + - php: 7.0 + env: LARAVEL=5.6 + - php: 7.0 + env: LARAVEL=5.7 + - php: 7.0 + env: LARAVEL=5.8 + - php: 7.0 + env: LARAVEL=6.0 + - php: 7.1 + env: LARAVEL=6.0 before_script: - export COMPOSER=tests/composer-$LARAVEL.json diff --git a/phpunit.xml.dist b/phpunit.xml.dist index abf6b3a1..85d1a508 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ -=5.6.4", + "illuminate/support": "5.4.*", + "illuminate/validation": "5.4.*", + "illuminate/contracts": "5.4.*", + "illuminate/view": "5.4.*", + "illuminate/config": "5.4.*", + "illuminate/http": "5.4.*", + "illuminate/translation": "5.4.*" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "mockery/mockery": "^0.9.8" + }, + "autoload": { + "psr-4": { + "Proengsoft\\JsValidation\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Proengsoft\\JsValidation\\Tests\\": "tests" + } + } +} diff --git a/tests/composer-5.6.json b/tests/composer-5.6.json new file mode 100644 index 00000000..2875cacf --- /dev/null +++ b/tests/composer-5.6.json @@ -0,0 +1,26 @@ +{ + "require": { + "php": ">=7.1.3", + "illuminate/support": "5.6.*", + "illuminate/validation": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/view": "5.6.*", + "illuminate/config": "5.6.*", + "illuminate/http": "5.6.*", + "illuminate/translation": "5.6.*" + }, + "require-dev": { + "phpunit/phpunit": "^7.0", + "mockery/mockery": "^1.0" + }, + "autoload": { + "psr-4": { + "Proengsoft\\JsValidation\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Proengsoft\\JsValidation\\Tests\\": "tests" + } + } +} diff --git a/tests/composer-5.7.json b/tests/composer-5.7.json new file mode 100644 index 00000000..f62642b0 --- /dev/null +++ b/tests/composer-5.7.json @@ -0,0 +1,26 @@ +{ + "require": { + "php": ">=7.1.3", + "illuminate/support": "5.7.*", + "illuminate/validation": "5.7.*", + "illuminate/contracts": "5.7.*", + "illuminate/view": "5.7.*", + "illuminate/config": "5.7.*", + "illuminate/http": "5.7.*", + "illuminate/translation": "5.7.*" + }, + "require-dev": { + "phpunit/phpunit": "^7.0", + "mockery/mockery": "^1.0" + }, + "autoload": { + "psr-4": { + "Proengsoft\\JsValidation\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Proengsoft\\JsValidation\\Tests\\": "tests" + } + } +} diff --git a/tests/composer-5.8.json b/tests/composer-5.8.json new file mode 100644 index 00000000..1f4f66c9 --- /dev/null +++ b/tests/composer-5.8.json @@ -0,0 +1,26 @@ +{ + "require": { + "php": ">=7.1.3", + "illuminate/support": "5.8.*", + "illuminate/validation": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/view": "5.8.*", + "illuminate/config": "5.8.*", + "illuminate/http": "5.8.*", + "illuminate/translation": "5.8.*" + }, + "require-dev": { + "phpunit/phpunit": "^7.0", + "mockery/mockery": "^1.0" + }, + "autoload": { + "psr-4": { + "Proengsoft\\JsValidation\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Proengsoft\\JsValidation\\Tests\\": "tests" + } + } +} diff --git a/tests/composer-6.0.json b/tests/composer-6.0.json new file mode 100644 index 00000000..2ccd01a0 --- /dev/null +++ b/tests/composer-6.0.json @@ -0,0 +1,26 @@ +{ + "require": { + "php": ">=7.2.0", + "illuminate/support": "^6.0", + "illuminate/validation": "^6.0", + "illuminate/contracts": "^6.0", + "illuminate/view": "^6.0", + "illuminate/config": "^6.0", + "illuminate/http": "^6.0", + "illuminate/translation": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0", + "mockery/mockery": "^1.0" + }, + "autoload": { + "psr-4": { + "Proengsoft\\JsValidation\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Proengsoft\\JsValidation\\Tests\\": "tests" + } + } +} From 22bb189258a86d22b60e89523ea5f00d6e1cee08 Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Tue, 5 Nov 2019 12:53:45 +0000 Subject: [PATCH 3/5] removed code coverage (https://github.com/sebastianbergmann/php-code-coverage/issues/551#issuecomment-386003740) --- phpunit.xml.dist | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 85d1a508..c5e9360f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -22,8 +22,6 @@ - - From e2676d43a87e5b9313ad8d0848f63fbe247ed6d4 Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Tue, 5 Nov 2019 12:55:13 +0000 Subject: [PATCH 4/5] fixed incompatible with parent --- tests/Facades/JsVaidatorFacadeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Facades/JsVaidatorFacadeTest.php b/tests/Facades/JsVaidatorFacadeTest.php index 5b3d31fe..039f202d 100644 --- a/tests/Facades/JsVaidatorFacadeTest.php +++ b/tests/Facades/JsVaidatorFacadeTest.php @@ -11,7 +11,7 @@ class JsValidatorFacadeTest extends TestCase { /** * Calls Mockery::close */ - public function tearDown() + protected function tearDown() { m::close(); } From 6731ec38b8fbfa1b8de9087d9f076f533ae6e2af Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Tue, 5 Nov 2019 15:02:41 +0000 Subject: [PATCH 5/5] downgrade phpunit --- tests/composer-6.0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/composer-6.0.json b/tests/composer-6.0.json index 2ccd01a0..af120daa 100644 --- a/tests/composer-6.0.json +++ b/tests/composer-6.0.json @@ -10,7 +10,7 @@ "illuminate/translation": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^7.0", "mockery/mockery": "^1.0" }, "autoload": {