- Timestamp:
- 05/14/2016 04:52:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/tests/phpunit/testcases/core/class-bp-email.php
r10541 r10760 251 251 $this->assertSame( $new_recipient, $addresses[1]->get_address() ); 252 252 } 253 254 public function test_html_entities_are_decoded_in_email_subject() { 255 // Emulate custom post title for an email post type. 256 $subject = "It's pretty <new & magical."; 257 258 $email = new BP_Email( 'activity-at-message' ); 259 $email->set_subject( $subject )->set_tokens( array( 'poster.name' => 'blah' ) ); 260 261 // Subject always has to have tokens replaced before sending. 262 $this->assertSame( $subject, $email->get_subject( 'replace-tokens' ) ); 263 } 264 265 public function test_html_entities_are_decoded_in_email_recipient_names() { 266 // Raw display name. 267 $name = "Test o'Toole"; 268 269 // Emulate rendered {poster.name} token. 270 $token = apply_filters( 'bp_core_get_user_displayname', $name ); 271 272 $email = new BP_Email( 'activity-at-message' ); 273 $email->set_subject( '{{poster.name}}' )->set_tokens( array( 'poster.name' => $token ) ); 274 275 // Subject always has to have tokens replaced before sending. 276 $this->assertSame( $name, $email->get_subject( 'replace-tokens' ) ); 277 } 278 253 279 }
Note: See TracChangeset
for help on using the changeset viewer.