-
Notifications
You must be signed in to change notification settings - Fork 79
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 #17 from cedriclombardot/more-date-headers
Match more date quotes headers
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,7 +181,31 @@ public function testCustomQuoteHeader2() | |
$this->parser->setQuoteHeadersRegex($regex); | ||
|
||
$email = $this->parser->parse($this->getFixtures('email_customer_quote_header_2.txt')); | ||
$fragments = $email->getFragments(); | ||
$this->assertCount(2, $fragments); | ||
|
||
$this->assertEquals('Thank you very much.', $email->getVisibleText()); | ||
$this->assertTrue($fragments[1]->isHidden()); | ||
$this->assertTrue($fragments[1]->isQuoted()); | ||
} | ||
|
||
/** | ||
* @dataProvider getDateFormats | ||
*/ | ||
public function testDateQuoteHeader($date) | ||
{ | ||
$email = $this->parser->parse(str_replace('[DATE]', $date, $this->getFixtures('email_with_date_headers.txt'))); | ||
|
||
$this->assertEquals('Thank you very much.', $email->getVisibleText()); | ||
} | ||
|
||
public function getDateFormats() | ||
{ | ||
return array( | ||
array('On Tue, 2011-03-01 at 18:02 +0530, Abhishek Kona wrote:'), | ||
array('2014-03-20 8:48 GMT+01:00 Rémi Dolan <[email protected]>:'), // Gmail | ||
array('Le 19 mars 2014 10:37, Cédric Lombardot <[email protected]> a écrit :'), // Gmail | ||
array('Le 19/03/2014 11:34, Georges du chemin a écrit :'), // Thunderbird | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Thank you very much. | ||
|
||
[DATE] | ||
|
||
This is my previous mail |
4842dd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@willdurand any chance to get a release with this change in it ?
4842dd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sure!
4842dd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.1.0 is released!