Skip to content

Commit

Permalink
update unit test as per new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
faisal-alvi committed Sep 22, 2023
1 parent 97c5487 commit 24a661e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/phpunit/multisite/SimpleLocalAvatarsNetworkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,30 @@ public function test_get_simple_local_avatar_url() {
'return' => 'http://example.com',
'times' => 1,
] );
WP_Mock::userFunction( 'wp_upload_dir', [
'args' => [],
'return' => ['baseurl' => '', 'basedir' => ''],
'times' => 1,
] );
WP_Mock::userFunction( 'wp_get_image_editor', [
'args' => [ '/avatar.png' ],
'return' => false,
'times' => 1,
] );
WP_Mock::userFunction( 'is_wp_error', [
'return' => true,
'times' => 1,
] );
WP_Mock::userFunction( 'update_user_meta', [
'args' => [ 1, 'simple_local_avatar', ['media_id' => 101, 'full' => '/avatar.png', 96 => '/avatar.png'] ],
'return' => true,
'times' => 1,
] );
WP_Mock::userFunction( 'home_url', [
'args' => [ '/avatar.png' ],
'return' => 'https://example.com/avatar-96x96.png',
'times' => 1,
] );
WP_Mock::userFunction( 'get_option' )
->with( 'avatar_rating' )
->andReturn( false );
Expand Down

0 comments on commit 24a661e

Please sign in to comment.