You are here

public function ConstraintViolationListTest::testArrayAccess in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/validator/Tests/ConstraintViolationListTest.php \Symfony\Component\Validator\Tests\ConstraintViolationListTest::testArrayAccess()

File

vendor/symfony/validator/Tests/ConstraintViolationListTest.php, line 85

Class

ConstraintViolationListTest

Namespace

Symfony\Component\Validator\Tests

Code

public function testArrayAccess() {
  $violation = $this
    ->getViolation('Error');
  $this->list[] = $violation;
  $this
    ->assertSame($violation, $this->list[0]);
  $this
    ->assertTrue(isset($this->list[0]));
  unset($this->list[0]);
  $this
    ->assertFalse(isset($this->list[0]));
  $this->list[10] = $violation;
  $this
    ->assertSame($violation, $this->list[10]);
  $this
    ->assertTrue(isset($this->list[10]));
}