Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patchwork 2.0.3 #92

Merged
merged 3 commits into from
May 27, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Updated patchwork to 2.0.3
  • Loading branch information
krodyrobi committed Mar 27, 2017
commit be62e35094a9703c6195313ade300ba0ee002391
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"php" : ">=5.3.2",
"phpunit/phpunit" : ">=4.3",
"mockery/mockery" : "^0.9.5",
"antecedent/patchwork": "~1.3.4"
"antecedent/patchwork": "~2.0.3"
},
"require-dev": {
"behat/behat" : "^3.0"
Expand Down
4 changes: 2 additions & 2 deletions php/WP_Mock/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function flush() {
Handler::cleanup();
$this->patchwork_functions = array();
if ( function_exists( 'Patchwork\undoAll' ) ) {
\Patchwork\undoAll();
\Patchwork\restoreAll();
}
if ( empty( self::$wp_mocked_functions ) ) {
self::$wp_mocked_functions = array(
Expand Down Expand Up @@ -239,7 +239,7 @@ private function replace_function( $function_name ) {
return true;
}
$this->patchwork_functions[] = $function_name;
\Patchwork\replace( $function_name, function () use ( $function_name ) {
\Patchwork\redefine( $function_name, function () use ( $function_name ) {
return Handler::handle_function( $function_name, func_get_args() );
} );
return true;
Expand Down
2 changes: 1 addition & 1 deletion php/WP_Mock/Tools/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected function mockStaticMethod( $class, $method = null ) {
$mock->shouldAllowMockingProtectedMethods();
$this->mockedStaticMethods[ $signature ] = $mock;

\Patchwork\Interceptor\patch( "$class::$method", function () use ( $mock, $safe_method ) {
\Patchwork\redefine( "$class::$method", function () use ( $mock, $safe_method ) {
return call_user_func_array( array( $mock, $safe_method ), func_get_args() );
}, ! ( $rMethod ) );
}
Expand Down