[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

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

   1  <?php
   2  
   3  use \Mockery as m;
   4  
   5  class ApplicationsTest extends PHPUnit_Framework_TestCase {
   6      protected $formHeaders = array('Content-Type' => 'application/x-www-form-urlencoded');
   7      function testPost()
   8      {
   9          $http = m::mock(new Services_Twilio_TinyHttp);
  10          $http->shouldReceive('post')->once()
  11              ->with('/2010-04-01/Accounts/AC123/Applications.json',
  12                  $this->formHeaders, 'FriendlyName=foo&VoiceUrl=bar')
  13              ->andReturn(array(200, array('Content-Type' => 'application/json'),
  14                  json_encode(array('sid' => 'AP123'))
  15              ));
  16          $client = new Services_Twilio('AC123', '123', '2010-04-01', $http);
  17          $app = $client->account->applications->create('foo', array(
  18              'VoiceUrl' => 'bar',
  19          ));
  20          $this->assertEquals('AP123', $app->sid);
  21      }
  22  
  23      function tearDown()
  24      {
  25          m::close();
  26      }
  27  }
  28  


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