Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889735
PhageAgentTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhageAgentTestCase.php
View Options
<?php
final
class
PhageAgentTestCase
extends
PhutilTestCase
{
public
function
testPhagePHPAgent
(
)
{
if
(
phutil_is_windows
(
)
)
{
$this
->
assertSkipped
(
pht
(
'Phage does not target Windows.'
)
)
;
}
return
$this
->
runBootloaderTests
(
new
PhagePHPAgentBootloader
(
)
)
;
}
private
function
runBootloaderTests
(
PhageAgentBootloader
$boot
)
{
$name
=
get_class
(
$boot
)
;
$exec
=
new
ExecFuture
(
'%C'
,
$boot
->
getBootCommand
(
)
)
;
$exec
->
write
(
$boot
->
getBootSequence
(
)
,
$keep_open
=
true
)
;
$exec_channel
=
new
PhutilExecChannel
(
$exec
)
;
$agent
=
new
PhutilJSONProtocolChannel
(
$exec_channel
)
;
$agent
->
write
(
array
(
'type'
=>
'EXEC'
,
'key'
=>
1
,
'command'
=>
'echo phage'
,
'timeout'
=>
null
,
)
)
;
$this
->
agentExpect
(
$agent
,
array
(
'type'
=>
'RSLV'
,
'key'
=>
1
,
'err'
=>
0
,
'stdout'
=>
"phage\n"
,
'stderr'
=>
''
,
'timeout'
=>
false
,
)
,
pht
(
"'%s' for %s"
,
'echo phage'
,
$name
)
)
;
$agent
->
write
(
array
(
'type'
=>
'EXIT'
,
)
)
;
}
private
function
agentExpect
(
PhutilChannel
$agent
,
$expect
,
$what
)
{
$message
=
$agent
->
waitForMessage
(
)
;
$this
->
assertEqual
(
$expect
,
$message
,
$what
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 12:34 (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1117202
Default Alt Text
PhageAgentTestCase.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment