csv-validator/tests/ViolationTest.php

25 lines
683 B
PHP
Raw Normal View History

2016-05-22 18:37:12 +02:00
<?php
2020-01-20 11:04:04 +01:00
use PHPUnit\Framework\TestCase;
2016-05-22 18:37:12 +02:00
use Symfony\Component\Validator\ConstraintViolation;
use Deblan\CsvValidator\Violation;
2020-01-20 11:04:04 +01:00
class ViolationTest extends TestCase
2016-05-22 18:37:12 +02:00
{
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);
}
}