public function test_valid_subject()
 {
     $message = 'test';
     $email = new BP_Email('activity-at-message');
     $email->set_subject($message)->set_tokens(array('poster.name' => 'example'));
     $this->assertSame($message, $email->get_subject());
 }
 public function test_html_entities_are_decoded_in_email_recipient_names()
 {
     // Raw display name.
     $name = "Test o'Toole";
     // Emulate rendered {poster.name} token.
     $token = apply_filters('bp_core_get_user_displayname', $name);
     $email = new BP_Email('activity-at-message');
     $email->set_subject('{{poster.name}}')->set_tokens(array('poster.name' => $token));
     // Subject always has to have tokens replaced before sending.
     $this->assertSame($name, $email->get_subject('replace-tokens'));
 }