| 270 | |
| 271 | public function test_html_entities_are_decoded_in_email_subject() { |
| 272 | $text = "It’s pretty <new & magical."; |
| 273 | $html = wptexturize( $text ); |
| 274 | |
| 275 | $email = new BP_Email( 'activity-at-message' ); |
| 276 | $email->set_subject( $html )->set_tokens( array( 'poster.name' => 'example' ) ); |
| 277 | |
| 278 | $this->assertSame( $text, $email->get_subject() ); |
| 279 | } |
| 280 | |
| 281 | public function test_html_entities_are_decoded_in_email_recipient_names() { |
| 282 | $name = "Test o'Toole"; |
| 283 | xprofile_set_field_data( 1, $this->u1, $name ); |
| 284 | |
| 285 | global $field; |
| 286 | $field = new BP_XProfile_ProfileData( 1, $this->u1 ); |
| 287 | $xprofile_name = apply_filters( 'bp_get_the_profile_field_value', $field->value, $field->type, 1 ); |
| 288 | |
| 289 | die(var_dump($xprofile_name, $field )); |
| 290 | |
| 291 | //$html = wptexturize( $text ); |
| 292 | $email = new BP_Email( 'activity-at-message' ); |
| 293 | $email->set_subject( $html )->set_tokens( array( 'poster.name' => 'example' ) ); |
| 294 | $html = html_entity_decode( $email->get_subject(), ENT_QUOTES ); |
| 295 | |
| 296 | $this->assertSame( $text, $html ); |
| 297 | } |
| 298 | |