From 688ea6f9335a0b8a9cffb8728df4365cb4a0a9ea Mon Sep 17 00:00:00 2001 From: James Date: Wed, 10 Jan 2024 18:24:46 +1000 Subject: [PATCH] fill empty test --- tests/Mail/MailMailableTest.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/Mail/MailMailableTest.php b/tests/Mail/MailMailableTest.php index f7f1eae7a7fb..8e17cce973a6 100644 --- a/tests/Mail/MailMailableTest.php +++ b/tests/Mail/MailMailableTest.php @@ -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()