示例#1
0
文件: SMSTest.php 项目: pontifex/sms
 /**
  *
  */
 public function testSendWithValidItemsButNeededFilter()
 {
     $creditUsedPerOneSMS = 7;
     $obj = new SMS($this->makeSMSAPIMock("SUCCESS:2:{$creditUsedPerOneSMS}"));
     $obj->getAdapter()->setEventManager($this->makeEventManagerMock());
     $item = new Struct\SMS();
     $item->setTo(new Struct\NumberTo(self::GERMANY, '987654test321'));
     $item->setFrom(new Struct\NumberFrom(self::GERMANY, '123456test789'));
     $item->setMessage(new Struct\Message('My message'));
     $coll = $this->makeSMSCollection();
     $coll->attach($item);
     $actual = $obj->send($coll);
     $this->assertEquals($creditUsedPerOneSMS * $coll->count(), $actual->getCreditUsed());
 }
示例#2
0
 /**
  * @return \SMS\Model\SMS
  */
 public function makeMock()
 {
     $adapter = new Mock();
     $adapter->setFacadeSMS($this->getFacadeSMS());
     $sms = new SMS();
     $sms->setAdapter($adapter);
     return $sms;
 }