Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,40 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

env:
matrix:
- LARAVEL=5.4
- 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
Expand Down
4 changes: 1 addition & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
<phpunit bootstrap="tests/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
Expand All @@ -22,8 +22,6 @@
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
6 changes: 3 additions & 3 deletions tests/Facades/JsVaidatorFacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
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
*/
public function tearDown()
protected function tearDown()
{
m::close();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Javascript/JavascriptRulesTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions tests/Javascript/JavascriptValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Javascript/MessageParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Javascript/RuleParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Javascript/ValidatorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/JsValidationServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/JsValidatorFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Remote/ResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Remote/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/RemoteValidationMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/AccessProtectedTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Proengsoft\JsValidation\Support;

use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

class ProtectedClassStubTest
{
Expand All @@ -14,7 +14,7 @@ protected function protectedMethod()
}
}

class AccessProtectedTraitTest extends PHPUnit_Framework_TestCase
class AccessProtectedTraitTest extends TestCase
{
private $mockTrait;
private $stubInstance;
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/DelegatedValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/RuleListTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions tests/Support/UseDelegatedValidatorTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
47 changes: 47 additions & 0 deletions tests/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/

require __DIR__.'/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| PHPUnit 4/5/6 Support
|--------------------------------------------------------------------------
|
| PHPUnit 6 introduced a breaking change that removed
| PHPUnit_Framework_TestCase as a base class, and replaced it with
| \PHPUnit\Framework\TestCase
|
*/

if (! class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
}

if (! class_exists('\PHPUnit_Framework_Assert') && class_exists('\PHPUnit\Framework\Assert')) {
class_alias('\PHPUnit\Framework\Assert', 'PHPUnit_Framework_Assert');
}

if (! class_exists('\PHPUnit_Framework_ExpectationFailedException') && class_exists('\PHPUnit\Framework\ExpectationFailedException')) {
class_alias('\PHPUnit\Framework\ExpectationFailedException', 'PHPUnit_Framework_ExpectationFailedException');
}

if (! class_exists('\PHPUnit_Framework_Constraint_Not') && class_exists('\PHPUnit\Framework\Constraint\LogicalNot')) {
class_alias('\PHPUnit\Framework\Constraint\LogicalNot', 'PHPUnit_Framework_Constraint_Not');
}

if (! class_exists('\PHPUnit_Framework_Constraint') && class_exists('\PHPUnit\Framework\Constraint\Constraint')) {
class_alias('\PHPUnit\Framework\Constraint\Constraint', 'PHPUnit_Framework_Constraint');
}

26 changes: 26 additions & 0 deletions tests/composer-5.5.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
26 changes: 26 additions & 0 deletions tests/composer-5.6.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
26 changes: 26 additions & 0 deletions tests/composer-5.7.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Loading