Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94163975
PhutilPHPObjectProtocolChannelTestCase.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
Wed, Dec 4, 09:56
Size
653 B
Mime Type
text/x-php
Expires
Fri, Dec 6, 09:56 (1 d, 13 h)
Engine
blob
Format
Raw Data
Handle
22748669
Attached To
rPHU libphutil
PhutilPHPObjectProtocolChannelTestCase.php
View Options
<?php
final
class
PhutilPHPObjectProtocolChannelTestCase
extends
PhutilTestCase
{
public
function
testPHPObjectChannelBasics
()
{
list
(
$x
,
$y
)
=
PhutilSocketChannel
::
newChannelPair
();
$xp
=
new
PhutilPHPObjectProtocolChannel
(
$x
);
$yp
=
new
PhutilPHPObjectProtocolChannel
(
$y
);
$object
=
(
object
)
array
(
'key'
=>
mt_rand
(),
);
$xp
->
write
(
$object
);
$xp
->
flush
();
$result
=
$yp
->
waitForMessage
();
$this
->
assertEqual
(
true
,
(
array
)
$object
===
(
array
)
$result
,
"Values are identical."
);
$this
->
assertEqual
(
false
,
$object
===
$result
,
"Objects are not the same."
);
}
}
Event Timeline
Log In to Comment