Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92592968
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
Thu, Nov 21, 19:31
Size
550 B
Mime Type
text/x-php
Expires
Sat, Nov 23, 19:31 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22465717
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