Refactoring, tests

This commit is contained in:
Simon Vieille 2016-05-22 18:37:12 +02:00
commit 8210838485
3 changed files with 83 additions and 18 deletions

View file

@ -1,8 +0,0 @@
<?php
class ValidatorTest extends \PHPUnit_Framework_TestCase
{
public function testAddLine()
{
}
}

23
tests/ViolationTest.php Normal file
View file

@ -0,0 +1,23 @@
<?php
use Symfony\Component\Validator\ConstraintViolation;
use Deblan\CsvValidator\Violation;
class ViolationTest extends \PHPUnit_Framework_TestCase
{
public function testViolation()
{
$constraintViolation = $this->generateConstraintViolation();
$violation = new Violation(1, 2, $constraintViolation);
$this->assertEquals(1, $violation->getLine());
$this->assertEquals(2, $violation->getColumn());
$this->assertEquals($constraintViolation, $violation->getViolation());
}
protected function generateConstraintViolation()
{
return new ConstraintViolation('foo', 'foo', [], null, '', null);
}
}