Skip to content

Commit f882122

Browse files
committed
magento#27589 Expect exactly one greeting in the Template
1 parent 16cb18d commit f882122

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dev/tests/integration/testsuite/Magento/Customer/Controller/Account/EmailTemplateTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ private function assertSameGreeting(string $expectedGreeting, EmailMessage $mess
170170
$emailDom->loadHTML($messageContent);
171171

172172
$emailXpath = new \DOMXPath($emailDom);
173-
$greeting = $emailXpath->query('//p[@class="greeting"]')->item(0);
173+
$greeting = $emailXpath->query('//p[@class="greeting"]');
174174

175-
$this->assertSame($expectedGreeting, $greeting->textContent);
175+
$this->assertSame(1, $greeting->length);
176+
$this->assertSame($expectedGreeting, $greeting->item(0)->textContent);
176177
}
177178

178179
/**

0 commit comments

Comments
 (0)