示例#1
0
 /**
  * @covers SmsZilla\Adapter\SmsCenterAdapter::send
  * @todo   Implement testSend().
  */
 public function testSend()
 {
     $message = new \SmsZilla\SmsMessageModel();
     $message->setText($this->config['message']);
     $message->addRecipient($this->config['my_phone']);
     $this->object->setParams(['login' => $this->config['smscenter_login'], 'password' => $this->config['smscenter_password'], 'sender' => $this->config['smscenter_sender']]);
     $result = $this->object->send($message, false);
     $this->assertTrue($result);
     $this->assertCount(0, $this->object->getErrors());
 }
示例#2
0
 /**
  * @covers SmsZilla\Adapter\SmsApiAdapter::send
  * @covers SmsZilla\Adapter\AbstractAdapter::getErrors
  * @covers \SmsZilla\SendingError::__construct
  */
 public function testSend()
 {
     $message = new \SmsZilla\SmsMessageModel();
     $message->setText($this->config['message']);
     $message->addRecipient($this->config['my_phone']);
     $this->object->setParams(['token' => $this->config['smsapi_token']]);
     $result = $this->object->send($message);
     var_dump($this->object->getErrors());
     $this->assertTrue($result);
     $this->assertCount(0, $this->object->getErrors());
 }
示例#3
0
 /**
  * @covers SmsZilla\Adapter\InfobipAdapter::send
  * @todo   Implement testSend().
  */
 public function testSend()
 {
     $message = new \SmsZilla\SmsMessageModel();
     $message->setText($this->config['message']);
     foreach ($this->config['my_phones'] as $no) {
         $message->addRecipient($no);
     }
     $this->object->setParams(['token' => $this->config['infobip_token']]);
     $result = $this->object->send($message);
     $this->assertTrue($result);
     $this->assertCount(0, $this->object->getErrors());
 }
示例#4
0
 /**
  * @covers SmsZilla\Adapter\CiscoAdapter::send
  * @covers SmsZilla\SmsMessageModel::setText
  * @covers SmsZilla\SmsMessageModel::addRecipient
  * @covers SmsZilla\Adapter\AbstractAdapter::setParams
  * @covers SmsZilla\Adapter\AbstractAdapter::getErrors
  * @covers SmsZilla\Adapter\AbstractAdapter::addError
  */
 public function testSendSsh()
 {
     $message = new \SmsZilla\SmsMessageModel();
     $message->setText($this->config['message']);
     $message->addRecipient($this->config['phones'][0]);
     $this->object->setParams(['use_ssh' => true]);
     $this->object->setParams(['ssh_login' => 'dummy_user']);
     $this->object->setParams(['ssh_host' => '127.0.0.1']);
     $result = $this->object->send($message);
     $this->assertTrue($result);
     $this->assertCount(0, $this->object->getErrors());
 }
示例#5
0
 /**
  * @covers SmsZilla\Adapter\FileAdapter::send
  */
 public function testSend()
 {
     $this->object->setParams(['store_path' => __DIR__]);
     $message = new \SmsZilla\SmsMessageModel();
     $message->setText($this->config['message']);
     $message->addRecipient($this->config['phones'][0]);
     $this->assertFileNotExists(__DIR__ . DIRECTORY_SEPARATOR . $this->config['phones'][0] . \SmsZilla\Adapter\FileAdapter::FILE_EXT);
     $message->addRecipient($this->config['phones'][1]);
     $this->object->send($message);
     $this->assertFileExists(__DIR__ . DIRECTORY_SEPARATOR . $this->config['phones'][0] . \SmsZilla\Adapter\FileAdapter::FILE_EXT);
     $this->assertFileExists(__DIR__ . DIRECTORY_SEPARATOR . $this->config['phones'][1] . \SmsZilla\Adapter\FileAdapter::FILE_EXT);
     $file = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . $this->config['phones'][0] . \SmsZilla\Adapter\FileAdapter::FILE_EXT);
     $ref = '[' . $this->config['phones'][0] . ']' . PHP_EOL . $message->getText() . PHP_EOL;
     $this->assertEquals($file, $file);
     $this->assertCount(0, $this->object->getErrors());
 }