Skip to content

Commit

Permalink
Move WP_Mock::passthruFunction( 'sanitize_title' ) to ::setUp()
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Oct 17, 2024
1 parent 17926a8 commit de10231
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/phpunit/includes/HiiveConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function setUp(): void {
parent::setUp();

WP_Mock::passthruFunction( '__' );
WP_Mock::passthruFunction( 'sanitize_title' );

WP_Mock::userFunction( 'wp_json_encode' )->andReturnUsing(
function ( $input ) {
Expand Down Expand Up @@ -46,8 +47,6 @@ public function test_plugin_sends_boxname_to_hiive(): void {
$plugin->expects( 'get' )->once()->with( 'version', '0' )->andReturn( '1.2.3' );
container()->set( 'plugin', $plugin );

WP_Mock::passthruFunction( 'sanitize_title' );

WP_Mock::userFunction( 'get_option' )->once()->with( 'newfold_cache_level', 2 )->andReturn( 2 );
WP_Mock::userFunction( 'get_option' )->once()->with( 'newfold_cloudflare_enabled', false )->andReturn( false );
WP_Mock::userFunction( 'get_option' )->once()->with( 'admin_email' )->andReturn( '[email protected]' );
Expand Down Expand Up @@ -77,8 +76,6 @@ public function test_plugin_sends_server_path_to_hiive(): void {
$plugin->expects( 'get' )->once()->with( 'version', '0' )->andReturn( '1.2.3' );
container()->set( 'plugin', $plugin );

WP_Mock::passthruFunction( 'sanitize_title' );

WP_Mock::userFunction( 'get_option' )->once()->with( 'newfold_cache_level', 2 )->andReturn( 2 );
WP_Mock::userFunction( 'get_option' )->once()->with( 'newfold_cloudflare_enabled', false )->andReturn( false );
WP_Mock::userFunction( 'get_option' )->once()->with( 'admin_email' )->andReturn( '[email protected]' );
Expand Down

0 comments on commit de10231

Please sign in to comment.