コード例 #1
0
ファイル: Test_Mock.php プロジェクト: d4rkstar/pagi
 /**
  * @test
  */
 public function can_example_mock()
 {
     $mock = new PAGI\Client\Impl\MockedClientImpl($this->_properties);
     $mock->assert('waitDigit', array(1000))->assert('streamFile', array('blah', '01234567890*#'))->assert('getData', array('blah', 123, '#'))->assert('sayDateTime', array('asd', 123))->assert('setVariable', array('asd', 'asd'))->assert('setCallerId', array('name', 'number'))->assert('playBusyTone')->assert('playDialTone')->assert('playCongestionTone')->assert('stopPlayingTones')->assert('playTone', array('some'))->assert('playCustomTones', array(1, 2, 3))->assert('amd', array())->onAnswer(true)->onWaitDigit(false)->onWaitDigit(true, '*')->onStreamFile(false)->onStreamFile(true, '#')->onGetData(false)->onGetData(true, '44449*#')->onSayDate(true, '#')->onSayTime(true, '#')->onSayDateTime(true, '#')->onSayAlpha(true, '#')->onSayPhonetic(true, '#')->onSayNumber(true, '#')->onSayDigits(true, '#')->onAmd('status', 'cause')->onHangup(true)->onChannelStatus(PAGI\Client\ChannelStatus::LINE_UP);
     $mock->answer();
     $mock->waitDigit(1000);
     $mock->waitDigit(1000);
     $mock->streamFile('blah', '01234567890*#');
     $mock->streamFile('blah', '01234567890*#');
     $mock->getData('blah', 123, '#');
     $mock->getData('blah', 123, '#');
     $mock->sayDate('asd', time());
     $mock->sayTime('asd', time());
     $mock->sayDateTime('asd', 123);
     $mock->sayAlpha('asd');
     $mock->sayPhonetic('asd');
     $mock->sayNumber(123);
     $mock->sayDigits(123);
     $mock->amd();
     $mock->hangup();
     $mock->channelStatus();
     $mock->setCallerId('name', 'number');
     $mock->playBusyTone();
     $mock->playDialTone();
     $mock->playCongestionTone();
     $mock->stopPlayingTones();
     $mock->playTone('some');
     $mock->playCustomTones(array(1, 2, 3));
     $mock->consoleLog("blah");
     $mock->log("blah");
     $mock->setVariable('asd', 'asd');
     $mock->setContext('context');
     $mock->setExtension('extension');
     $mock->setPriority(1);
     $mock->setMusic(true);
 }