Skip to content

Commit

Permalink
Check that Patchwork\redefine is defined instead of Patchwork\Interce…
Browse files Browse the repository at this point in the history
…ptor\patch
  • Loading branch information
wvega authored and unfulvio-godaddy committed Sep 19, 2022
1 parent e178c7e commit b35de01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/WP_Mock/Tools/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,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

0 comments on commit b35de01

Please sign in to comment.