示例#1
0
文件: SmsTest.php 项目: headzoo/nexmo
 /**
  * @covers ::text
  * @expectedException Headzoo\Nexmo\Exception\ThrottledException
  */
 public function testTextThrottledException()
 {
     $guzzle = $this->getMockGuzzle("12015555555", "Testing", "My ref", 1, "Messages throttled");
     $sms = new Sms($guzzle);
     $sms->setKey($this->key)->setSecret($this->secret)->setFrom($this->from);
     $sms->text("12015555555", "Testing", "My ref");
 }
示例#2
0
 public function authenticate(array $options)
 {
     $this->service = Sms::factory($options['api_key'], $options['api_secret'], null);
 }
示例#3
0
文件: Sms.php 项目: headzoo/nexmo
 /**
  * Creates and returns a new Sms instance
  * 
  * @param string $key    Your API key
  * @param string $secret Your API secret
  * @param string $from   Sender address
  *
  * @return Sms
  */
 public static function factory($key, $secret, $from)
 {
     $sms = new Sms(new GuzzleHttp\Client());
     $sms->setKey($key)->setSecret($secret)->setFrom($from);
     return $sms;
 }