[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 use \Mockery as m; 4 5 class QueuesTest extends PHPUnit_Framework_TestCase { 6 7 protected $formHeaders = array('Content-Type' => 'application/x-www-form-urlencoded'); 8 9 function testCreate() { 10 $http = m::mock(new Services_Twilio_TinyHttp); 11 $http->shouldReceive('post')->once() 12 ->with('/2010-04-01/Accounts/AC123/Queues.json', $this->formHeaders, 13 'FriendlyName=foo&MaxSize=123') 14 ->andReturn(array(200, array('Content-Type' => 'application/json'), 15 json_encode(array('sid' => 'QQ123', 'average_wait_time' => 0)) 16 )); 17 $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); 18 $queue = $client->account->queues->create('foo', 19 array('MaxSize' => 123)); 20 $this->assertSame($queue->sid, 'QQ123'); 21 $this->assertSame($queue->average_wait_time, 0); 22 } 23 24 function tearDown() { 25 m::close(); 26 } 27 } 28
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |