forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildQueryTest.php
56 lines (43 loc) · 1.3 KB
/
BuildQueryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once 'Twilio.php';
class BuildQueryTest extends PHPUnit_Framework_TestCase {
public function testSimpleQueryString() {
$data = array(
'foo' => 'bar',
'baz' => 'bin',
);
$this->assertEquals(Services_Twilio::buildQuery($data), 'foo=bar&baz=bin');
}
public function testSameKey() {
$data = array(
'foo' => array(
'bar',
'baz',
'bin',
),
'boo' => 'bah',
);
$this->assertEquals(Services_Twilio::buildQuery($data),
'foo=bar&foo=baz&foo=bin&boo=bah');
}
public function testKeylessData() {
$data = array(
'bar',
'baz',
'bin',
);
$this->assertEquals(Services_Twilio::buildQuery($data), '0=bar&1=baz&2=bin');
}
public function testKeylessDataPrefix() {
$data = array(
'bar',
'baz',
'bin',
);
$this->assertEquals(Services_Twilio::buildQuery($data, 'var'), 'var0=bar&var1=baz&var2=bin');
}
public function testQualifiedUserAgent() {
$expected = Services_Twilio::USER_AGENT . " (php 5.4)";
$this->assertEquals(Services_Twilio::qualifiedUserAgent("5.4"), $expected);
}
}