/**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->Table, $this->Behavior, $this->Email);
     Router::fullBaseUrl($this->fullBaseBackup);
     Email::dropTransport('test');
     parent::tearDown();
 }
예제 #2
0
 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->Users);
     Router::fullBaseUrl($this->fullBaseBackup);
     Email::drop('default');
     Email::dropTransport('test');
     Email::config('default', $this->configEmail);
     parent::tearDown();
 }
 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     Email::drop('default');
     Email::dropTransport('test');
     Email::config('default', $this->configEmail);
     Configure::write('Opauth', $this->configOpauth);
     Configure::write('Users.RememberMe.active', $this->configRememberMe);
     parent::tearDown();
 }
예제 #4
0
 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->table, $this->Trait);
     if ($this->mockDefaultEmail) {
         Email::drop('default');
         Email::dropTransport('test');
         Email::config('default', $this->configEmail);
     }
     parent::tearDown();
 }
예제 #5
0
 /**
  * Test dropping a transport configuration
  *
  * @return void
  */
 public function testDropTransport()
 {
     $result = Email::configTransport('debug');
     $this->assertInternalType('array', $result, 'Should have config data');
     Email::dropTransport('debug');
     $this->assertNull(Email::configTransport('debug'), 'Should not exist.');
 }
예제 #6
0
 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->Table, $this->Behavior);
     Email::dropTransport('test');
     parent::tearDown();
 }
예제 #7
0
파일: EmailTest.php 프로젝트: UnionCMS/Core
 /**
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Plugin::unload('Union/Core');
     CakeEmail::dropTransport('default');
 }
예제 #8
0
 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     Email::drop('default');
     Email::dropTransport('test');
     parent::tearDown();
 }
예제 #9
0
    /**
     * Test method
     *
     * @return void
     */
    public function testSendResetPasswordEmail()
    {
        $behavior = $this->table->behaviors()->Password;
        $this->fullBaseBackup = Router::fullBaseUrl();
        Router::fullBaseUrl('http://users.test');
        Email::configTransport('test', ['className' => 'Debug']);
        $this->Email = new Email(['from' => '*****@*****.**', 'transport' => 'test', 'template' => 'CakeDC/Users.reset_password', 'emailFormat' => 'both']);
        $user = $this->table->newEntity(['first_name' => 'FirstName', 'email' => '*****@*****.**', 'token' => '12345']);
        $result = $behavior->sendResetPasswordEmail($user, $this->Email, 'CakeDC/Users.reset_password');
        $this->assertTextContains('From: test@example.com', $result['headers']);
        $this->assertTextContains('To: test@example.com', $result['headers']);
        $this->assertTextContains('Subject: FirstName, Your reset password link', $result['headers']);
        $this->assertTextContains('Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Hi FirstName,

Please copy the following address in your web browser http://users.test/users/users/reset-password/12345
Thank you,
', $result['message']);
        $this->assertTextContains('Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
    <title>Email/html</title>
</head>
<body>
    <p>
Hi FirstName,
</p>
<p>
    <strong><a href="http://users.test/users/users/reset-password/12345">Reset your password here</a></strong>
</p>
<p>
    If the link is not correcly displayed, please copy the following address in your web browser http://users.test/users/users/reset-password/12345</p>
<p>
    Thank you,
</p>
</body>
</html>
', $result['message']);
        Router::fullBaseUrl($this->fullBaseBackup);
        Email::dropTransport('test');
    }
 public function tearDown()
 {
     Email::dropTransport('default');
 }