Ejemplo n.º 1
0
 /**
  * @test
  */
 public function testCreateCode()
 {
     $this->assertNull($this->fixture->getCode());
     $this->fixture->updateAuth();
     $code = $this->fixture->getCode();
     $timestamp = $this->fixture->getLastSent();
     $this->assertNotEmpty($code);
     $this->assertNotEmpty($timestamp);
     sleep(1);
     $this->fixture->updateAuth();
     $this->assertNotEquals($code, $this->fixture->getCode());
     $this->assertNotEquals($timestamp, $this->fixture->getLastSent());
 }
Ejemplo n.º 2
0
 /**
  * Send optin mail for subscirber
  *
  * @param Subscriber $subscriber
  * @param Comment $comment Comment
  *
  * @return void
  */
 protected function sendOptInMail(Subscriber $subscriber, Comment $comment)
 {
     $this->log->dev('Send subscriber opt-in mail.');
     $post = $subscriber->getPost();
     $subscriber->updateAuth();
     $this->subscriberRepository->update($subscriber);
     $subject = $this->translate('subject.subscriber.new', $post->getTitle());
     $variables = array('post' => $post, 'comment' => $comment, 'subscriber' => $subscriber, 'subject' => $subject, 'validUntil' => $this->getValidUntil());
     $emailBody = $this->emailService->render($variables, 'SubscriberOptinMail.txt');
     $this->emailService->send($subscriber->getMailTo(), $this->settings['subscriptionManager']['subscriber']['mailFrom'], $subject, $emailBody);
 }