Changeset 9948 for trunk/tests/phpunit/testcases/messages/template.php
- Timestamp:
- 06/16/2015 10:48:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/messages/template.php
r9819 r9948 260 260 261 261 /** 262 * @group bp_has_message_threads 263 */ 264 public function test_has_message_threads_anonymous_user_should_not_see_threads() { 265 $u1 = $this->factory->user->create(); 266 $u2 = $this->factory->user->create(); 267 268 // create initial thread 269 $this->factory->message->create( array( 270 'sender_id' => $u1, 271 'recipients' => array( $u2 ), 272 ) ); 273 274 // set user to anonymous 275 $old_current_user = get_current_user_id(); 276 $this->set_current_user( 0 ); 277 278 // now, do the message thread query 279 global $messages_template; 280 bp_has_message_threads(); 281 282 // assert! 283 $this->assertEquals( 0, $messages_template->thread_count ); 284 $this->assertEmpty( $messages_template->threads ); 285 286 $this->set_current_user( $old_current_user ); 287 } 288 289 /** 262 290 * @group pagination 263 291 * @group BP_Messages_Box_Template
Note: See TracChangeset
for help on using the changeset viewer.