Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
unfulvio-godaddy authored Sep 21, 2022
2 parents 9a80032 + a59821c commit 7d31b2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/WP_Mock/Tools/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected function mockStaticMethod( $class, $method = null ) {
if ( ! $method ) {
throw new Exception( sprintf( 'Could not mock %s::%s', $class, $method ) );
}
if ( ! WP_Mock::usingPatchwork() || ! function_exists( 'Patchwork\Interceptor\patch' ) ) {
if ( ! WP_Mock::usingPatchwork() || ! function_exists( 'Patchwork\redefine' ) ) {
throw new Exception( 'Patchwork is not loaded! Please load patchwork before mocking static methods!' );
}

Expand Down Expand Up @@ -197,7 +197,7 @@ protected function mockStaticMethod( $class, $method = null ) {

\Patchwork\redefine( "$class::$method", function () use ( $mock, $safe_method ) {
return call_user_func_array( array( $mock, $safe_method ), func_get_args() );
}, ! ( $rMethod ) );
} );
}
$expectation = $mock->shouldReceive( $safe_method );

Expand Down

0 comments on commit 7d31b2f

Please sign in to comment.