Skip to content

Commit

Permalink
add archive property to archive properties data on send
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Apr 3, 2020
1 parent 099bce4 commit 5479255
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions system/Test/Mock/MockEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@

class MockEmail extends Email
{
/**
* Record of mock emails sent.
*
* @var array
*/
public $archive = [];

public function send($autoClear = true)
{
$this->archive = get_object_vars($this);

if ($autoClear)
{
$this->clear();
Expand Down
1 change: 1 addition & 0 deletions tests/system/Email/EmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ public function testEmailSendWithClearance($autoClear)
$email->setTo('foo@foo.com');

$this->assertTrue($email->send($autoClear));
$this->assertEquals('foo@foo.com', $email->archive['recipients'][0]);
}
}

0 comments on commit 5479255

Please sign in to comment.