Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Jun 27, 2018
1 parent 2472364 commit de84d31
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/Gateways/YunpianGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ public function testSend()
$config = [
'api_key' => 'mock-api-key',
];
$gateway = \Mockery::mock(YunpianGateway::class.'[post]', [$config])->shouldAllowMockingProtectedMethods();
$gateway = \Mockery::mock(YunpianGateway::class.'[request]', [$config])->shouldAllowMockingProtectedMethods();

$gateway->shouldReceive('post')->with('https://sms.yunpian.com/v2/sms/single_send.json', [
'apikey' => 'mock-api-key',
'mobile' => '18188888888',
'text' => '【overtrue】This is a test message.',
$gateway->shouldReceive('request')->with('post', 'https://sms.yunpian.com/v2/sms/single_send.json', [
'form_params' => [
'apikey' => 'mock-api-key',
'mobile' => '18188888888',
'text' => '【overtrue】This is a test message.',
],
'exceptions' => false,
])->andReturn([
'code' => 0,
'msg' => '发送成功',
Expand Down

0 comments on commit de84d31

Please sign in to comment.