forked from deblan/csv-validator
Refactoring, tests
This commit is contained in:
parent
852c359f86
commit
8210838485
3 changed files with 83 additions and 18 deletions
|
|
@ -1,8 +0,0 @@
|
|||
<?php
|
||||
|
||||
class ValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testAddLine()
|
||||
{
|
||||
}
|
||||
}
|
||||
23
tests/ViolationTest.php
Normal file
23
tests/ViolationTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue