Compare commits

...

5 commits
2 ... master

Author SHA1 Message Date
Simon Vieille a2e1ac418c
add jenkins status
All checks were successful
Gitnet/csv-validator/pipeline/head This commit looks good
2020-09-01 16:28:22 +02:00
Simon Vieille 2d06d4adc5
add jenkins tests
All checks were successful
Gitnet/csv-validator/pipeline/head This commit looks good
2020-09-01 16:25:29 +02:00
Simon Vieille fac4371d69
fix issue with validation 2020-09-01 16:24:29 +02:00
Simon Vieille 0b9c77ae7f
add compatibility with deblan/csv@v3 2020-09-01 16:24:15 +02:00
Simon Vieille cd43e2fed9
upgrade dependencies (php7) 2020-01-20 11:04:04 +01:00
9 changed files with 42 additions and 9 deletions

25
Jenkinsfile vendored Normal file
View file

@ -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'
}
}
}
}

4
Makefile Normal file
View file

@ -0,0 +1,4 @@
.PHONY: tests
tests:
phpunit

View file

@ -1,7 +1,7 @@
csv-validator
=============
[![](https://phpci.gitnet.fr/build-status/image/1?branch=master&label=PHPCensor&style=flat-square)](https://phpci.gitnet.fr/build-status/view/1)
[![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

View file

@ -15,8 +15,8 @@
},
"minimum-stability": "dev",
"require": {
"php": ">=5.6.0",
"symfony/validator": "3.*",
"deblan/csv": "v2.0.*"
"php": "^7.1.3",
"symfony/validator": "^4",
"deblan/csv": "v2.0.*|v3.*"
}
}

View file

@ -7,7 +7,6 @@
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "true"
bootstrap = "vendor/autoload.php" >
<testsuites>

View file

@ -122,6 +122,7 @@ class Validator
if ($this->parser !== $parser) {
$this->parser = $parser;
$this->errors = [];
$this->hasValidate = false;
} elseif ($this->hasValidate) {
return;
}

View file

@ -1,11 +1,13 @@
<?php
use PHPUnit\Framework\TestCase;
/**
* class ExampleTest.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class ExampleTest extends \PHPUnit_Framework_TestCase
class ExampleTest extends TestCase
{
public function testExemple()
{

View file

@ -1,18 +1,19 @@
<?php
use PHPUnit\Framework\TestCase;
use Deblan\Csv\CsvParser;
use Deblan\CsvValidator\Validator;
use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Email;
class ValidatorTest extends \PHPUnit_Framework_TestCase
class ValidatorTest extends TestCase
{
public function testViolation()
{
$parser = $this->generateParser('example.csv');
$validator = $this->generateValidator($parser);
$this->setExpectedException('\RuntimeException');
$this->expectException('\RuntimeException');
$validator->isValid();
}

View file

@ -1,9 +1,10 @@
<?php
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\ConstraintViolation;
use Deblan\CsvValidator\Violation;
class ViolationTest extends \PHPUnit_Framework_TestCase
class ViolationTest extends TestCase
{
public function testViolation()
{