Exemple #1
0
 /**
  * @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");
 }
Exemple #2
0
 public function authenticate(array $options)
 {
     $this->service = Sms::factory($options['api_key'], $options['api_secret'], null);
 }
Exemple #3
0
 /**
  * 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;
 }