@@ -20,7 +20,9 @@ public function it_extracts_the_recipient()
2020 (new TestMailable ())->to (['jane@doe.com ' ])
2121 );
2222
23- $ this ->assertEquals (['john@doe.com ' , 'jane@doe.com ' ], $ composer ->getData ('recipient ' ));
23+ $ this ->assertCount (2 , $ composer ->getData ('recipient ' ));
24+ $ this ->assertContains ('john@doe.com ' , $ composer ->getData ('recipient ' ));
25+ $ this ->assertContains ('jane@doe.com ' , $ composer ->getData ('recipient ' ));
2426 }
2527
2628 /** @test */
@@ -107,29 +109,20 @@ public function it_extracts_the_from_address_and_or_name()
107109class TestMailable extends Mailable
108110{
109111 /**
110- * Create a new message instance .
112+ * Build the message.
111113 *
112- * @return void
114+ * @return $this
113115 */
114- public function __construct ()
116+ public function build ()
115117 {
116- $ this ->to ('john@doe.com ' )
118+ return $ this ->to ('john@doe.com ' )
117119 ->cc (['john+cc@doe.com ' , 'john+cc2@doe.com ' ])
118120 ->bcc (['john+bcc@doe.com ' , 'john+bcc2@doe.com ' ])
119121 ->subject ('Your order has shipped! ' )
120122 ->attach (__DIR__ . '/files/pdf-sample.pdf ' , [
121123 'mime ' => 'application/pdf ' ,
122124 ])
123- ->attachData ('<p>Thanks for your oder</p> ' , 'order.html ' );
124- }
125-
126- /**
127- * Build the message.
128- *
129- * @return $this
130- */
131- public function build ()
132- {
133- return $ this ->view ('tests::dummy ' , ['name ' => 'John Doe ' ]);
125+ ->attachData ('<p>Thanks for your oder</p> ' , 'order.html ' )
126+ ->view ('tests::dummy ' , ['name ' => 'John Doe ' ]);
134127 }
135128}
0 commit comments