Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Aug 3, 2020
1 parent cb6182f commit af6782b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/EasySmsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Overtrue\EasySms\Contracts\PhoneNumberInterface;
use Overtrue\EasySms\EasySms;
use Overtrue\EasySms\Exceptions\InvalidArgumentException;
use Overtrue\EasySms\Gateways\AliyunGateway;
use Overtrue\EasySms\Message;
use Overtrue\EasySms\Messenger;
use Overtrue\EasySms\PhoneNumber;
Expand Down Expand Up @@ -57,6 +58,11 @@ public function testGatewayWithoutDefaultSetting()

public function testGatewayWithDefaultSetting()
{
$easySms = new EasySms(['default' => 'aliyun']);
$this->assertSame('aliyun', $easySms->getDefaultGateway());
$this->assertInstanceOf(AliyunGateway::class, $easySms->gateway());

// class name
$easySms = new EasySms(['default' => DummyGatewayForTest::class]);
$this->assertSame(DummyGatewayForTest::class, $easySms->getDefaultGateway());
$this->assertInstanceOf(DummyGatewayForTest::class, $easySms->gateway());
Expand Down

0 comments on commit af6782b

Please sign in to comment.