[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

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

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


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