Skip to content

Commit

Permalink
Different approach; allow mocking protected methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyred committed Apr 21, 2017
1 parent 00351a5 commit 7103067
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Payment/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public function sandboxMode($enabled = false)
*
* @param string $resource
*/
public function wrapApi($resource)
protected function wrapApi($resource)
{
return self::API_HOST.($this->sandboxEnabled ? '/sandbox' : '').$resource;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Payment/PaymentAPITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getAPI()
'notify_url' => 'merchant_default_notify_url',
]);

$api = \Mockery::mock('EasyWeChat\Payment\API[getHttp]', [$merchant]);
$api = \Mockery::mock('EasyWeChat\Payment\API[getHttp]', [$merchant])->shouldAllowMockingProtectedMethods();
$api->shouldReceive('getHttp')->andReturn($http);

return $api;
Expand Down

0 comments on commit 7103067

Please sign in to comment.