Skip to content

Commit

Permalink
Update test_class.publicize.php
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Jan 17, 2025
1 parent b2185c6 commit 5f9388c
Showing 1 changed file with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,8 @@ public function test_publicize_get_all_connections_for_user() {
$facebook_connection = array(
'id_number' => array(
'connection_data' => array(
'id' => 123,
'user_id' => 0,
'service_name' => 'facebook',
'connection_id' => 123,
'can_disconnect' => true,
'profile_link' => false,
'shared' => false,
'status' => 'ok',
'id' => 123,
'user_id' => 0,
),
),
);
Expand All @@ -284,7 +278,27 @@ public function test_publicize_get_all_connections_for_user() {

// When logged out, assert that blog-level connections are returned.
wp_set_current_user( 0 );
$this->assertSame( array( 'facebook' => $facebook_connection ), $publicize->get_all_connections_for_user() );
$this->assertSame(
array(
'facebook' => array_merge_recursive(
$facebook_connection,
array(
'id_number' => array(
'connection_data' => array(
'service_name' => 'facebook',
'connection_id' => 123,
'can_disconnect' => true,
'profile_link' => false,
'shared' => false,
'status' => 'ok',

),
),
)
),
),
$publicize->get_all_connections_for_user()
);

// When logged in, assert that blog-level connections AND any connections for the current user are returned.
wp_set_current_user( 1 );
Expand Down

0 comments on commit 5f9388c

Please sign in to comment.