Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90404993
BuildQueryTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 1, 09:32
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 3, 09:32 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22070225
Attached To
rPH Phabricator
BuildQueryTest.php
View Options
<?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
);
}
}
Event Timeline
Log In to Comment