コード例 #1
0
 public function testErrorCollection()
 {
     $message = new Message();
     $this->assertInstanceOf(get_class(new ArrayCollection()), $message->getErrors());
     $this->assertEmpty($message->getErrors());
     $error1 = new Error();
     $message->addError($error1);
     $this->assertCount(1, $message->getErrors());
     $error2 = new Error();
     $message->addError($error2);
     $this->assertCount(2, $message->getErrors());
     $message->removeError($error1);
     $this->assertCount(1, $message->getErrors());
 }