Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Add test for existing empty test #49632

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tests/Mail/MailMailableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,38 @@ public function build()

public function testAssertHasSubject()
{
Container::getInstance()->instance('mailer', new class
{
public function render()
{
//
}
});

$mailable = new class() extends Mailable
{
public function build()
{
//
}
};

try {
$mailable->assertHasSubject('Foo Subject');
$this->fail();
} catch (AssertionFailedError $e) {
$this->assertSame("Did not see expected text [Foo Subject] in email subject.\nFailed asserting that false is true.", $e->getMessage());
}

$mailable = new class() extends Mailable
{
public function build()
{
$this->subject('Foo Subject');
}
};

$mailable->assertHasSubject('Foo Subject');
}

public function testMailableHeadersGetSent()
Expand Down