-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable use of retun_path on SparkPost through get/SetReturnPath on Sp…
…arkPost messages
- Loading branch information
1 parent
e87a884
commit 4fe4df0
Showing
3 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -371,4 +371,31 @@ public function testCampaignId() | |
$sparkPostServiceMock = $this->expectApiResponse(200); | ||
$sparkPostServiceMock->send($message); | ||
} | ||
|
||
|
||
public function testReturnPath() | ||
{ | ||
/** @var SparkPost $message */ | ||
$message = $this->getMessageObject(); | ||
|
||
// default value is null | ||
$this->assertNull($message->getReturnPath()); | ||
|
||
// accepts null-value as a way to unset the return path | ||
$message->setReturnPath('[email protected]'); | ||
$message->setReturnPath(null); | ||
$this->assertNull($message->getReturnPath()); | ||
|
||
// nullify empty string | ||
$message->setReturnPath(''); | ||
$this->assertNull($message->getReturnPath()); | ||
|
||
// regular use | ||
$message->setReturnPath('[email protected]'); | ||
$this->assertEquals('[email protected]', $message->getReturnPath()); | ||
|
||
// successful transmission injection | ||
$sparkPostServiceMock = $this->expectApiResponse(200); | ||
$sparkPostServiceMock->send($message); | ||
} | ||
} |