public function testStopOnFirstError()
{
$this->filter->throwExceptions();
$item = array('foo' => 'bar');
$violation = $this->getMock('Symfony\\Component\\Validator\\ConstraintViolationInterface');
$list = new ConstraintViolationList(array($violation));
$this->validator->expects($this->once())->method('validate')->willReturn($list);
try {
call_user_func($this->filter, $item);
$this->fail('ValidationException should be thrown');
} catch (ValidationException $e) {
$this->assertSame(1, $e->getLineNumber());
$this->assertEquals($list, $e->getViolations());
}
}