Skip to content

Commit

Permalink
Removed EmailTrait from TestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyharris committed Apr 27, 2018
1 parent 952552c commit 88acd45
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/TestSuite/EmailTrait.php
Expand Up @@ -26,13 +26,27 @@
/**
* Make assertions on emails sent through the Cake\TestSuite\TestEmailTransport
*
* After adding the trait to your test case, replace all mail transports with the
* TestEmailTransport:
*
* **tests/bootstrap.php**
* ```
* use Cake\TestSuite\TestEmailTransport;
*
* // replaces existing transports with the TestEmailTransport for email assertions
* TestEmailTransport::replaceAllTransports();
* ```
*
* Then, in your test case's tearDown method, clean up previously sent emails:
*
* ```
* public function tearDown()
* {
* // other cleanup
* parent::tearDown();
* TestEmailTransport::clearEmails();
* }
* ```
*/
trait EmailTrait
{
Expand Down
2 changes: 0 additions & 2 deletions src/TestSuite/TestCase.php
Expand Up @@ -33,7 +33,6 @@
abstract class TestCase extends BaseTestCase
{

use EmailTrait;
use LocatorAwareTrait;

/**
Expand Down Expand Up @@ -160,7 +159,6 @@ public function tearDown()
Configure::write($this->_configure);
}
$this->getTableLocator()->clear();
TestEmailTransport::clearEmails();
}

/**
Expand Down

0 comments on commit 88acd45

Please sign in to comment.