Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93729184
PhutilJSONProtocolChannelTestCase.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
Sun, Dec 1, 00:58
Size
550 B
Mime Type
text/x-php
Expires
Tue, Dec 3, 00:58 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22695041
Attached To
rPHU libphutil
PhutilJSONProtocolChannelTestCase.php
View Options
<?php
final
class
PhutilJSONProtocolChannelTestCase
extends
PhutilTestCase
{
public
function
testJSONChannelBasics
()
{
list
(
$x
,
$y
)
=
PhutilSocketChannel
::
newChannelPair
();
$xp
=
new
PhutilJSONProtocolChannel
(
$x
);
$yp
=
new
PhutilJSONProtocolChannel
(
$y
);
$dict
=
array
(
'rand'
=>
mt_rand
(),
'list'
=>
array
(
1
,
2
,
3
),
'null'
=>
null
,
);
$xp
->
write
(
$dict
);
$xp
->
flush
();
$result
=
$yp
->
waitForMessage
();
$this
->
assertEqual
(
$dict
,
$result
,
"Values are identical."
);
}
}
Event Timeline
Log In to Comment