-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix message rendering tests for iframed message parts
- Loading branch information
Showing
4 changed files
with
25 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,6 @@ class SingleImageNoTextTest extends MessageRenderingTestCase | |
*/ | ||
public function testShowMultipartMixedSingleImageToo(): void | ||
{ | ||
$this->markTestSkipped('TBD: test for fixing GH issue 9443'); | ||
// This next comment line prevents phpstan from reporting this as | ||
// unreachable code (technically it is right, but that's on purpose | ||
// here...). | ||
// @phpstan-ignore-next-line | ||
$domxpath = $this->renderMessage('[email protected]'); | ||
|
||
$this->assertSame('Not OK', $this->getScrubbedSubject($domxpath)); | ||
|
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 |
---|---|---|
|
@@ -11,7 +11,8 @@ public function testTnefEmail1(): void | |
{ | ||
$domxpath = $this->renderMessage('[email protected]'); | ||
|
||
$this->assertSame('', $this->getBody($domxpath)); | ||
$bodyParts = $domxpath->query('//iframe[contains(@class, "framed-message-part")]'); | ||
$this->assertCount(0, $bodyParts, 'Message body parts'); | ||
|
||
$attchNames = $domxpath->query('//span[@class="attachment-name"]'); | ||
$this->assertCount(1, $attchNames, 'Attachments'); | ||
|
@@ -22,7 +23,13 @@ public function testTnefEmail2(): void | |
{ | ||
$domxpath = $this->renderMessage('[email protected]'); | ||
|
||
$this->assertStringStartsWith('THE BILL OF RIGHTSAmendments 1-10 of the', $this->getBody($domxpath)); | ||
$bodyParts = $domxpath->query('//iframe[contains(@class, "framed-message-part")]'); | ||
$this->assertCount(1, $bodyParts, 'Message body parts'); | ||
$params = $this->getSrcParams($bodyParts[0]); | ||
$this->assertSrcUrlParams($params, 'winmail.1.html'); | ||
$body = $this->getIframedContent($params); | ||
|
||
$this->assertStringStartsWith('THE BILL OF RIGHTSAmendments 1-10 of the', trim($body)); | ||
|
||
$attchNames = $domxpath->query('//span[@class="attachment-name"]'); | ||
$this->assertCount(0, $attchNames, 'Attachments'); | ||
|
@@ -32,7 +39,13 @@ public function testTnefEmail3(): void | |
{ | ||
$domxpath = $this->renderMessage('[email protected]'); | ||
|
||
$bodyParagraphs = $domxpath->query('//div[@class="rcmBody"]/p'); | ||
$bodyParts = $domxpath->query('//iframe[contains(@class, "framed-message-part")]'); | ||
$this->assertCount(1, $bodyParts, 'Message body parts'); | ||
$params = $this->getSrcParams($bodyParts[0]); | ||
$this->assertSrcUrlParams($params, 'winmail.1.html'); | ||
$domxpath_body = $this->renderIframedBodyContent($params); | ||
|
||
$bodyParagraphs = $domxpath_body->query('//p'); | ||
$this->assertCount(8, $bodyParagraphs, 'Body HTML paragraphs'); | ||
$this->assertSame('Casdasdfasdfasd', $bodyParagraphs[0]->textContent); | ||
$this->assertSame('Casdasdfasdfasd', $bodyParagraphs[1]->textContent); | ||
|