Skip to content

Commit

Permalink
Update SubmailGatewayTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored Aug 10, 2018
1 parent 4b591e2 commit 87df4b1
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions tests/Gateways/SubmailGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ public function testSend()

$gateway->send(new PhoneNumber(18188888888), $message, $config);
}

public function testProject()
{

public function testProject() {
$config = [
'app_id' => 'mock-app-id',
'app_key' => 'mock-app-key',
Expand All @@ -83,11 +82,7 @@ public function testProject()
'send_id' => '093c0a7df143c087d6cba9cdf0cf3738',
'fee' => 1,
'sms_credits' => 14197,
], [
'status' => 'error',
'code' => 100,
'msg' => 'mock-err-msg',
])->times(2);
]);

$message = new Message(['data' => ['code' => '123456', 'time' => '15', 'project' => 'mock-project']]);
$config = new Config($config);
Expand All @@ -98,11 +93,5 @@ public function testProject()
'fee' => 1,
'sms_credits' => 14197,
], $gateway->send(new PhoneNumber(18188888888), $message, $config));

$this->expectException(GatewayErrorException::class);
$this->expectExceptionCode(100);
$this->expectExceptionMessage('mock-err-msg');

$gateway->send(new PhoneNumber(18188888888), $message, $config);
}
}

0 comments on commit 87df4b1

Please sign in to comment.