Beispiel #1
0
 public function testAddComment()
 {
     $comment = $this->getMock('OroCRM\\Bundle\\CaseBundle\\Entity\\CaseComment');
     $comment->expects($this->once())->method('setCase')->with($this->case);
     $this->assertEquals($this->case, $this->case->addComment($comment));
     $this->assertEquals($comment, $this->case->getComments()->get(0));
 }
Beispiel #2
0
 /**
  * @param CaseEntity $case
  *
  * @return CaseComment
  */
 public function createComment(CaseEntity $case = null)
 {
     $comment = $this->createCommentObject();
     if ($case) {
         $case->addComment($comment);
     }
     return $comment;
 }