Exemple #1
0
 public function testUpdatedBy()
 {
     $this->assertNull($this->comment->getUpdatedBy());
     $value = $this->getMockBuilder('Oro\\Bundle\\UserBundle\\Entity\\User')->disableOriginalConstructor()->getMock();
     $this->assertEquals($this->comment, $this->comment->setUpdatedBy($value));
     $this->assertEquals($value, $this->comment->getUpdatedBy());
 }
Exemple #2
0
 /**
  * @Route(
  *      "/comment/{id}/update",
  *      name="orocrm_case_comment_update",
  *      requirements={"id"="\d+"}
  * )
  * @AclAncestor("orocrm_case_comment_update")
  * @Template
  */
 public function updateAction(CaseComment $comment)
 {
     $formAction = $this->get('router')->generate('orocrm_case_comment_update', ['id' => $comment->getId()]);
     $user = $this->getUser();
     if ($user instanceof User) {
         $comment->setUpdatedBy($user);
     }
     return $this->update($comment, $formAction);
 }