You are here

public function ConstraintViolationListTest::testArrayAccess in Plug 7

File

lib/Symfony/validator/Symfony/Component/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]));
}