@@ -10,7 +10,6 @@ |
||
| 10 | 10 | |
| 11 | 11 | use LaravelSms\sms\Sms; |
| 12 | 12 | use PHPUnit_Framework_TestCase; |
| 13 | -use Mockery as m; |
|
| 14 | 13 | |
| 15 | 14 | class SmsTest extends PHPUnit_Framework_TestCase |
| 16 | 15 | { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | { |
| 43 | 43 | $this->sms->to('123456...'); |
| 44 | 44 | $smsData = $this->smsData(); |
| 45 | - $this->assertEquals('123456...',$smsData['to']); |
|
| 45 | + $this->assertEquals('123456...', $smsData['to']); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function testSetContent() |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | * @param null $tempId |
| 73 | 73 | * @return $this |
| 74 | 74 | */ |
| 75 | - public function template($agentName='SMS_AGENT', $tempId = null) |
|
| 75 | + public function template($agentName = 'SMS_AGENT', $tempId = null) |
|
| 76 | 76 | { |
| 77 | - if ($agentName === 'SMS_AGENT'){ |
|
| 77 | + if ($agentName === 'SMS_AGENT') { |
|
| 78 | 78 | $agentName = $this->config; |
| 79 | 79 | } |
| 80 | 80 | if (is_array($agentName)) { |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function send() |
| 109 | 109 | { |
| 110 | - if($this->config=='YunTongXun'){ |
|
| 111 | - $rest=new Rest(config('sms.agents.'.$this->config)); |
|
| 112 | - return $rest->sendTemplateSMS($this->smsData['to'],$this->smsData['templateData'],$this->smsData['templates']['YunTongXun']); |
|
| 113 | - }else{ |
|
| 110 | + if ($this->config == 'YunTongXun') { |
|
| 111 | + $rest = new Rest(config('sms.agents.' . $this->config)); |
|
| 112 | + return $rest->sendTemplateSMS($this->smsData['to'], $this->smsData['templateData'], $this->smsData['templates']['YunTongXun']); |
|
| 113 | + } else { |
|
| 114 | 114 | throw new \Exception('make sure you have choose a right agent'); |
| 115 | 115 | } |
| 116 | 116 | } |