[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/twilio-php/tests/resources/ -> SandboxTest.php (source)

   1  <?php
   2  
   3  use \Mockery as m;
   4  
   5  class SandboxTest extends PHPUnit_Framework_TestCase {
   6      protected $formHeaders = array('Content-Type' => 'application/x-www-form-urlencoded');
   7      function testUpdateVoiceUrl()
   8      {
   9          $http = m::mock(new Services_Twilio_TinyHttp);
  10          $http->shouldReceive('post')->once()
  11              ->with('/2010-04-01/Accounts/AC123/Sandbox.json', $this->formHeaders, 'VoiceUrl=foo')
  12              ->andReturn(array(200, array('Content-Type' => 'application/json'),
  13                  json_encode(array('voice_url' => 'foo'))
  14              ));
  15          $client = new Services_Twilio('AC123', '123', '2010-04-01', $http);
  16          $client->account->sandbox->update('VoiceUrl', 'foo');
  17          $this->assertEquals('foo', $client->account->sandbox->voice_url);
  18      }
  19  
  20      function tearDown() {
  21          m::close();
  22      }
  23  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1