-
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.
Merge pull request #150 from nickvanderveeken/feature/sparkpost-retur…
…n-path Enable SparkPost return path
- Loading branch information
Showing
4 changed files
with
62 additions
and
2 deletions.
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
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); | ||
} | ||
} |