Skip to content

Commit

Permalink
Added some vars to reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Apr 13, 2011
1 parent 82835a3 commit e6c8171
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Cake/Network/CakeEmail.php
Expand Up @@ -536,6 +536,15 @@ public function send() {
* @return void
*/
public function reset() {
$this->_to = array();
$this->_from = array();
$this->_replyTo = array();
$this->_readReceipt = array();
$this->_returnPath = array();
$this->_cc = array();
$this->_bcc = array();
$this->_subject = '';
$this->_headers = array();
}

}
5 changes: 5 additions & 0 deletions lib/Cake/tests/Case/Network/CakeEmailTest.php
Expand Up @@ -140,6 +140,11 @@ public function testSend() {
* @return void
*/
public function testReset() {
$this->CakeEmail->setTo('cake@cakephp.org');
$this->assertIdentical($this->CakeEmail->getTo(), array('cake@cakephp.org' => 'cake@cakephp.org'));

$this->CakeEmail->reset();
$this->assertIdentical($this->CakeEmail->getTo(), array());
}

}

0 comments on commit e6c8171

Please sign in to comment.