From dec69e9b56259169464eb18c22e47033e0ffa70f Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Thu, 28 Mar 2019 10:37:17 +0000 Subject: [PATCH 1/3] Bumped test suite to Laravel 5.5 and PHP 7.0+ --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From 4b8adc464830956a9c3403f5a1d27b743c188807 Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Thu, 28 Mar 2019 11:05:44 +0000 Subject: [PATCH 2/3] Updated tests to PHPUnit 6 --- 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 +++++++++++++++++++ 17 files changed, 56 insertions(+), 56 deletions(-) delete mode 100644 tests/composer-5.4.json create mode 100644 tests/composer-5.5.json 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 bbd0c32f..da4ee1a0 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 db9d9e7383e448ae77f8567216c087619480f271 Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Thu, 28 Mar 2019 11:07:40 +0000 Subject: [PATCH 3/3] Removed bad phpunit attributes --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ - +