send( $to, $from, $subject, $bodyText, $bodyHtml, $options ); // The test is successful if the status is good. $this->assertTrue( $status->isGood() ); } public function testSendWithBadAddress() { // Create a new Emailer object. $emailer = new Emailer(); // Send an email. $status = $emailer->send( new MailAddress( ' ', 'Sender', 'Real name' ), new MailAddress( ' ', 'Recipient', 'Real name' ), '', '', ); // The test is successful if the status is not good. $this->assertFalse( $status->isGood() ); } public function provideSend(): array { $from = new MailAddress( 'foo@example.com', 'UserName', 'Real name' ); $to = new MailAddress( 'bar@example.com', 'UserName', 'Real name' ); $bodyHtml = '

Hello, World!

'; return [ [ $to, $from, 'Test subject', 'Hello, World!' ], [ $to, $from, 'Test subject', 'Hello, World!', $bodyHtml ], [ $to, $from, 'Test subject', 'Hello, World!', $bodyHtml, [ 'cc' => [ $from ] ] ], ]; } }