Skip to content

Commit e63cea8

Browse files
fill empty test (#49632)
1 parent 8f48538 commit e63cea8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/Mail/MailMailableTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,38 @@ public function build()
11331133

11341134
public function testAssertHasSubject()
11351135
{
1136+
Container::getInstance()->instance('mailer', new class
1137+
{
1138+
public function render()
1139+
{
1140+
//
1141+
}
1142+
});
1143+
1144+
$mailable = new class() extends Mailable
1145+
{
1146+
public function build()
1147+
{
1148+
//
1149+
}
1150+
};
1151+
1152+
try {
1153+
$mailable->assertHasSubject('Foo Subject');
1154+
$this->fail();
1155+
} catch (AssertionFailedError $e) {
1156+
$this->assertSame("Did not see expected text [Foo Subject] in email subject.\nFailed asserting that false is true.", $e->getMessage());
1157+
}
1158+
1159+
$mailable = new class() extends Mailable
1160+
{
1161+
public function build()
1162+
{
1163+
$this->subject('Foo Subject');
1164+
}
1165+
};
1166+
1167+
$mailable->assertHasSubject('Foo Subject');
11361168
}
11371169

11381170
public function testMailableHeadersGetSent()

0 commit comments

Comments
 (0)