This repository was archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Bugfix/duplicat subject header #225
Open
arueckauer
wants to merge
5
commits into
zendframework:master
Choose a base branch
from
arueckauer:bugfix/duplicat-subject-header
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
49fb520
Implemented test to verify to and subject headers are not duplicated
arueckauer 81bc5ca
Strip 'to' and 'subject' headers regardless of operating system, fixe…
arueckauer 500107f
Add CHANGELOG entry for #225
arueckauer cf79426
Removed initial value assignment, which is being overwritten in const…
arueckauer a37062e
Reference reporting issue
arueckauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ class SendmailTest extends TestCase | |
| public $message; | ||
| public $additional_headers; | ||
| public $additional_parameters; | ||
| public $operating_system; | ||
|
|
||
| public function setUp() | ||
| { | ||
|
|
@@ -71,9 +72,14 @@ public function getMessage() | |
| return $message; | ||
| } | ||
|
|
||
| public function isWindows() | ||
| { | ||
| return $this->operating_system === 'WIN'; | ||
| } | ||
|
|
||
| public function testReceivesMailArtifactsOnUnixSystems() | ||
| { | ||
| if ($this->operating_system == 'WIN') { | ||
| if ($this->isWindows()) { | ||
| $this->markTestSkipped('This test is *nix-specific'); | ||
| } | ||
|
|
||
|
|
@@ -119,7 +125,7 @@ public function testReceivesMailArtifactsOnWindowsSystems() | |
|
|
||
| public function testLinesStartingWithFullStopsArePreparedProperlyForWindows() | ||
| { | ||
| if ($this->operating_system != 'WIN') { | ||
| if (! $this->isWindows()) { | ||
| $this->markTestSkipped('This test is Windows-specific'); | ||
| } | ||
|
|
||
|
|
@@ -252,4 +258,33 @@ public function testDoNotAllowMessageWithoutToAndCcAndBccHeaders() | |
| $this->expectException(RuntimeException::class); | ||
| $this->transport->send($message); | ||
| } | ||
|
|
||
| /** | ||
| * @see https://github.com/zendframework/zend-mail/issues/22 | ||
| */ | ||
| public function testHeadersToAndSubjectAreNotDuplicated() | ||
| { | ||
| $lineBreak = $this->isWindows() ? "\r\n" : "\n"; | ||
|
|
||
| $message = new Message(); | ||
| $message | ||
| ->addTo('[email protected]') | ||
| ->addFrom('[email protected]') | ||
| ->setSubject('Greetings and Salutations!') | ||
| ->setBody("Sorry, I'm going to be late today!"); | ||
|
|
||
| $this->transport->send($message); | ||
|
|
||
| $this->assertEquals('[email protected]', $this->to); | ||
| $this->assertEquals('Greetings and Salutations!', $this->subject); | ||
|
|
||
| $this->assertNotContains( | ||
| 'To: [email protected], [email protected]' . $lineBreak, | ||
| $this->additional_headers | ||
| ); | ||
| $this->assertNotContains( | ||
| 'Subject: Greetings and Salutations!, Greetings and Salutations!' . $lineBreak, | ||
| $this->additional_headers | ||
| ); | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.