Changeset 11042
- Timestamp:
- 08/30/2016 03:44:33 PM (8 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/factory.php
r10004 r11042 158 158 'sender_id' => get_current_user_id(), 159 159 'thread_id' => 0, 160 'recipients' => array(),161 160 'subject' => new WP_UnitTest_Generator_Sequence( 'Message subject %s' ), 162 161 'content' => new WP_UnitTest_Generator_Sequence( 'Message content %s' ), … … 166 165 167 166 function create_object( $args ) { 168 $message_id = messages_new_message( $args ); 169 return $message_id; 170 } 171 172 function update_object( $group_id, $fields ) { 167 if ( empty( $args['sender_id'] ) ) { 168 $args['sender_id'] = $this->factory->user->create(); 169 } 170 171 if ( empty( $args['recipients'] ) ) { 172 $recipient = $this->factory->user->create_and_get(); 173 $args['recipients'] = array( $recipient->user_nicename ); 174 } 175 176 $thread_id = messages_new_message( $args ); 177 $thread = new BP_Messages_Thread( $thread_id ); 178 return end( $thread->messages )->id; 179 } 180 181 function update_object( $message_id, $fields ) { 173 182 // todo 174 183 } 175 184 176 function get_object_by_id( $ group_id ) {177 // todo185 function get_object_by_id( $message_id ) { 186 return new BP_Messages_Message( $message_id ); 178 187 } 179 188 }
Note: See TracChangeset
for help on using the changeset viewer.