diff --git a/.travis.yml b/.travis.yml
index a941551..e2c0986 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,21 +1,27 @@
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
-dist: precise
# list any PHP version you want to test against
php:
- - 5.3
- 5.4
- 5.5
- 5.6
+ - 7.0
+ - 7.1
+ - 7.2
+ - nightly
- hhvm
matrix:
allow_failures:
- php: hhvm
+ - php: nightly
+ include:
+ - php: 5.3
+ dist: precise
before_script:
- composer install
# Script to run tests
-script: ./vendor/bin/phpunit
+script: composer test
diff --git a/composer.json b/composer.json
index 066dda7..30e5c96 100644
--- a/composer.json
+++ b/composer.json
@@ -16,11 +16,19 @@
"php": ">=5.3.2"
},
"require-dev": {
- "phpunit/phpunit": "~4.8.35"
+ "phpunit/phpunit": "^4.8.35 || ^5.5 || ^6.5"
+ },
+ "suggest": {
+ "ext-mbstring": "It can support the multiple bytes string length."
},
"autoload": {
- "psr-0": {
- "Valitron": "src/"
+ "psr-4": {
+ "Valitron\\": "src/Valitron"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Valitron\\": "tests/Valitron"
}
},
"scripts": {
diff --git a/phpunit.xml b/phpunit.xml
index 5693a09..f23518b 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -15,4 +15,12 @@
tests/Valitron
+
+
+ src/
+
+
+ vendor/
+
+
diff --git a/tests/Valitron/ValidateTest.php b/tests/Valitron/ValidateTest.php
index e25f7a2..4cf5b59 100644
--- a/tests/Valitron/ValidateTest.php
+++ b/tests/Valitron/ValidateTest.php
@@ -15,11 +15,11 @@ class ValidateTest extends BaseTestCase
$this->assertEquals($v->data(), array('foo' => 'bar'));
}
- public function testAccurateErrorCount()
+ public function testAccurateErrorShouldReturnFalse()
{
$v = new Validator(array('name' => 'Chester Tester'));
$v->rule('required', 'name');
- $this->assertSame(1, count($v->errors('name')));
+ $this->assertFalse($v->errors('name'));
}
public function testArrayOfFieldsToValidate()
{
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index b4dcfb1..e33ce82 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -16,4 +16,4 @@ if($vendorPos !== false) {
$loader = require __DIR__.'/../vendor/autoload.php';
}
-require_once __DIR__ . '/Valitron/BaseTestCase.php';
\ No newline at end of file
+require_once __DIR__ . '/Valitron/BaseTestCase.php';