setEmailAuthCode() public method

public setEmailAuthCode ( $authCode )
Esempio n. 1
0
 public function testSendEmail()
 {
     $user = new User();
     $user->setTwoFactorAuthentication(true);
     $user->setEmailAuthCode(666666);
     $user->setEmail('*****@*****.**');
     $user->setName('Bob');
     $authCodeMailer = new AuthCodeMailer($this->mailer, $this->twig, '*****@*****.**', 'wallabag test', $this->config);
     $authCodeMailer->sendAuthCode($user);
     $this->assertCount(1, $this->spool);
     $msg = $this->spool->getMessages()[0];
     $this->assertArrayHasKey('*****@*****.**', $msg->getTo());
     $this->assertEquals(['*****@*****.**' => 'wallabag test'], $msg->getFrom());
     $this->assertEquals('subject', $msg->getSubject());
     $this->assertContains('text body http://0.0.0.0/support', $msg->toString());
     $this->assertContains('html body 666666', $msg->toString());
 }