ValidationExceptionSpec.php 849 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace spec\Ddeboer\DataImport\Exception;
  3. use PhpSpec\ObjectBehavior;
  4. use Symfony\Component\Validator\ConstraintViolationListInterface;
  5. class ValidationExceptionSpec extends ObjectBehavior
  6. {
  7. function let(ConstraintViolationListInterface $list)
  8. {
  9. $this->beConstructedWith($list, 1);
  10. }
  11. function it_is_initializable()
  12. {
  13. $this->shouldHaveType('Ddeboer\DataImport\Exception\ValidationException');
  14. }
  15. function it_is_an_exception()
  16. {
  17. $this->shouldHaveType('Exception');
  18. $this->shouldImplement('Ddeboer\DataImport\Exception');
  19. }
  20. function it_has_a_list_of_violations(ConstraintViolationListInterface $list)
  21. {
  22. $this->getViolations()->shouldReturn($list);
  23. }
  24. function it_has_a_line_number()
  25. {
  26. $this->getLineNumber()->shouldReturn(1);
  27. }
  28. }