/** * @test * * @return void */ public function testIsValidUnapprovedAndSpam() { $this->fixture->setApproved(FALSE); $this->fixture->setSpam(TRUE); $this->assertFalse($this->fixture->isValid()); }
/** * Process changed status of a comment * Comment is already persisted to DB * * @param Comment $comment Comment * * @return void */ public function processCommentStatusChanged(Comment $comment) { if ($comment->isValid()) { $subscriber = $this->subscriberRepository->findForSubscriptionMail($comment); if ($subscriber instanceof Subscriber) { $this->sendOptInMail($subscriber, $comment); } $this->notifySubscribers($comment); $this->persistToDatabase(); $this->flushFrontendCache(); } }