public function testSendLoadedHtml() { $token = $this->generateSubjectToken(); $email = new fEmail(); $email->setFromEmail('*****@*****.**'); $email->addRecipient(EMAIL_ADDRESS, 'Test User'); $email->setSubject($token . ': Testing Simple Email'); $email->setBody('This is a test of loading the HTML body'); $email->loadHTMLBody(new fFile('./email/loaded_body.html'), array('%REPLACE%' => 'This is a test')); $message_id = $email->send(); $message = $this->findMessage($token); $this->assertEquals($message_id, $message['headers']['Message-ID']); $this->assertEquals('*****@*****.**', $message['headers']['From']); $this->assertEquals($token . ': Testing Simple Email', $message['headers']['Subject']); $this->assertEquals('This is a test of loading the HTML body', $message['plain']); $this->assertEquals('<h1>Loaded HTML</h1><p>This is a test</p>', $message['html']); }