Sets the value of resolved.
public setResolved ( boolean $resolved ) : self | ||
$resolved | boolean | the resolved |
return | self |
/** * Resolve existing editorial comment * @param EditorialComment $comment * @param User $user */ public function resolve(EditorialComment $comment, User $user, $value = true) { if ($comment->getUser()->getId() == $user->getId() || $user->isAdmin()) { $comment->setResolved($value); } else { throw new AccessDeniedHttpException("User is not allowed to resolve comment"); } $this->em->flush(); return true; }
public function it_should_resolve_comment(EditorialComment $comment, User $user) { $comment->getUser()->willReturn($user); $comment->setResolved(Argument::type('bool'))->willReturn(true); $this->resolve($comment, $user)->shouldReturn(true); }