Exemplo n.º 1
0
 public function testAppend()
 {
     $errors = new MultiException();
     $this->assertTrue($errors->isEmpty());
     $errors->append(new Exception('First'));
     $this->assertFalse($errors->isEmpty());
     $this->assertEquals(1, $errors->count());
     $errors->append(new Exception('Second'));
     $this->assertFalse($errors->isEmpty());
     $this->assertEquals(2, $errors->count());
     $this->assertEquals([new Exception('First'), new Exception('Second')], $errors->toArray());
 }