diff --git tests/phpunit/testcases/messages/class.bp-messages-thread.php tests/phpunit/testcases/messages/class.bp-messages-thread.php
index 047d3b5..f5f2a11 100644
|
|
class BP_Tests_BP_Messages_Thread extends BP_UnitTestCase { |
23 | 23 | 'subject' => 'Bar', |
24 | 24 | ) ); |
25 | 25 | |
26 | | $threads = BP_Messages_Thread::get_current_threads_for_user( $u2, 'inbox', 'all', null, null, 'ar' ); |
| 26 | $threads = BP_Messages_Thread::get_current_threads_for_user( array( |
| 27 | 'user_id' => $u2, |
| 28 | 'search_terms' => 'ar', |
| 29 | ) ); |
27 | 30 | |
28 | 31 | $expected = array( $t2 ); |
29 | 32 | $found = wp_parse_id_list( wp_list_pluck( $threads['threads'], 'thread_id' ) ); |
… |
… |
class BP_Tests_BP_Messages_Thread extends BP_UnitTestCase { |
50 | 53 | 'subject' => 'Bar', |
51 | 54 | ) ); |
52 | 55 | |
| 56 | $threads = BP_Messages_Thread::get_current_threads_for_user( array( |
| 57 | 'user_id' => $u2, |
| 58 | 'box' => 'setnbox', |
| 59 | 'search_terms' => 'ar', |
| 60 | ) ); |
| 61 | |
| 62 | $expected = array( $t2 ); |
| 63 | $found = wp_parse_id_list( wp_list_pluck( $threads['threads'], 'thread_id' ) ); |
| 64 | |
| 65 | $this->assertSame( $expected, $found ); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @group get_current_threads_for_user |
| 70 | * @expectedDeprecated BP_Messages_Thread::get_current_threads_for_user |
| 71 | */ |
| 72 | public function test_get_current_threads_for_user_with_old_args() { |
| 73 | $u1 = $this->factory->user->create(); |
| 74 | $u2 = $this->factory->user->create(); |
| 75 | |
| 76 | $t1 = $this->factory->message->create( array( |
| 77 | 'sender_id' => $u1, |
| 78 | 'recipients' => array( $u2 ), |
| 79 | 'subject' => 'Foo', |
| 80 | ) ); |
| 81 | |
| 82 | $t2 = $this->factory->message->create( array( |
| 83 | 'sender_id' => $u1, |
| 84 | 'recipients' => array( $u2 ), |
| 85 | 'subject' => 'Bar', |
| 86 | ) ); |
| 87 | |
53 | 88 | $threads = BP_Messages_Thread::get_current_threads_for_user( $u1, 'sentbox', 'all', null, null, 'ar' ); |
54 | 89 | |
55 | 90 | $expected = array( $t2 ); |