diff --git a/phpci.yml b/.php-censor.yml similarity index 100% rename from phpci.yml rename to .php-censor.yml diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..6e0cddf --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,25 @@ +pipeline { + agent any + + stages { + stage('PHP 7.1') { + steps { + sh '/usr/local/bin/composer-php7.1 install' + sh 'php7.1 /usr/local/bin/phpunit-7' + } + } + stage('PHP 7.3') { + steps { + sh '/usr/local/bin/composer-php7.3 update' + sh 'php7.3 /usr/local/bin/phpunit-9' + } + } + stage('PHP 7.4') { + steps { + sh '/usr/local/bin/composer-php7.4 update' + sh 'php7.4 /usr/local/bin/phpunit-9' + } + } + } +} + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..990a451 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: tests + +tests: + phpunit diff --git a/README.md b/README.md index a83c640..48d866e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ csv-validator ============= -[![](https://phpci.gitnet.fr/build-status/image/2?branch=master&label=PHPCensor&style=flat-square)](https://phpci.gitnet.fr/build-status/view/2) +[![Build Status](https://ci.gitnet.fr/buildStatus/icon?job=Gitnet%2Fcsv-validator%2F3)](https://ci.gitnet.fr/job/Gitnet/job/csv-validator/job/3/) CSV validator library diff --git a/composer.json b/composer.json index 4e8a836..dd0a7c3 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ }, "minimum-stability": "dev", "require": { - "php": ">=5.6.0", - "symfony/validator": "2.*", - "deblan/csv": "v2.0.*" + "php": "^7.1.3", + "symfony/validator": "^4", + "deblan/csv": "v2.0.*|v3.*" } } diff --git a/phpunit.xml b/phpunit.xml index eabb967..eb8c372 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,7 +7,6 @@ convertWarningsToExceptions = "true" processIsolation = "false" stopOnFailure = "false" - syntaxCheck = "false" bootstrap = "vendor/autoload.php" > diff --git a/src/Deblan/CsvValidator/Validator.php b/src/Deblan/CsvValidator/Validator.php index 6374910..b590c9f 100644 --- a/src/Deblan/CsvValidator/Validator.php +++ b/src/Deblan/CsvValidator/Validator.php @@ -122,6 +122,7 @@ class Validator if ($this->parser !== $parser) { $this->parser = $parser; $this->errors = []; + $this->hasValidate = false; } elseif ($this->hasValidate) { return; } diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php index 4d0705f..0be5792 100644 --- a/tests/ExampleTest.php +++ b/tests/ExampleTest.php @@ -1,11 +1,13 @@ */ -class ExampleTest extends \PHPUnit_Framework_TestCase +class ExampleTest extends TestCase { public function testExemple() { diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php index f3d75ac..13d6462 100644 --- a/tests/ValidatorTest.php +++ b/tests/ValidatorTest.php @@ -1,18 +1,19 @@ generateParser('example.csv'); $validator = $this->generateValidator($parser); - $this->setExpectedException('\RuntimeException'); + $this->expectException('\RuntimeException'); $validator->isValid(); } diff --git a/tests/ViolationTest.php b/tests/ViolationTest.php index 1fd0484..c798ab4 100644 --- a/tests/ViolationTest.php +++ b/tests/ViolationTest.php @@ -1,9 +1,10 @@