Ticket #6969: 6969.01.patch
File 6969.01.patch, 1.3 KB (added by , 9 years ago) |
---|
-
src/bp-core/classes/class-bp-email-recipient.php
56 56 $name = sanitize_text_field( $name ); 57 57 58 58 // User ID, WP_User object. 59 if ( is_ int( $email_or_user ) || is_object( $email_or_user ) ) {59 if ( is_numeric( $email_or_user ) || is_object( $email_or_user ) ) { 60 60 $this->user_object = is_object( $email_or_user ) ? $email_or_user : get_user_by( 'id', $email_or_user ); 61 61 62 62 if ( $this->user_object ) { -
tests/phpunit/testcases/core/class-bp-email-recipient.php
63 63 $this->assertEmpty( $recipient->get_name() ); 64 64 } 65 65 66 public function test_return_with_string_numeric_user_id() { 67 $recipient = new BP_Email_Recipient( (string) $this->u1 ); 68 $this->assertSame( 'test@example.com', $recipient->get_address() ); 69 $this->assertSame( 'Unit Test', $recipient->get_name() ); 70 } 71 66 72 public function test_should_return_empty_string_if_user_id_id_invalid() { 67 73 $recipient = new BP_Email_Recipient( time() ); 68 74