[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 require_once 'Twilio.php'; 4 5 class BuildQueryTest extends PHPUnit_Framework_TestCase { 6 7 public function testSimpleQueryString() { 8 $data = array( 9 'foo' => 'bar', 10 'baz' => 'bin', 11 ); 12 13 $this->assertEquals(Services_Twilio::buildQuery($data), 'foo=bar&baz=bin'); 14 } 15 16 public function testSameKey() { 17 $data = array( 18 'foo' => array( 19 'bar', 20 'baz', 21 'bin', 22 ), 23 'boo' => 'bah', 24 ); 25 26 $this->assertEquals(Services_Twilio::buildQuery($data), 27 'foo=bar&foo=baz&foo=bin&boo=bah'); 28 } 29 30 public function testKeylessData() { 31 $data = array( 32 'bar', 33 'baz', 34 'bin', 35 ); 36 37 $this->assertEquals(Services_Twilio::buildQuery($data), '0=bar&1=baz&2=bin'); 38 } 39 40 public function testKeylessDataPrefix() { 41 $data = array( 42 'bar', 43 'baz', 44 'bin', 45 ); 46 47 $this->assertEquals(Services_Twilio::buildQuery($data, 'var'), 'var0=bar&var1=baz&var2=bin'); 48 } 49 50 public function testQualifiedUserAgent() { 51 $expected = Services_Twilio::USER_AGENT . " (php 5.4)"; 52 $this->assertEquals(Services_Twilio::qualifiedUserAgent("5.4"), $expected); 53 } 54 55 } 56
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 |