3
final class PhageAgentTestCase extends PhutilTestCase {
5
public function testPhagePHPAgent() {
6
return $this->runBootloaderTests(new PhagePHPAgentBootloader());
9
private function runBootloaderTests(PhageAgentBootloader $boot) {
10
$name = get_class($boot);
12
$exec = new ExecFuture('%C', $boot->getBootCommand());
13
$exec->write($boot->getBootSequence(), $keep_open = true);
15
$exec_channel = new PhutilExecChannel($exec);
16
$agent = new PhutilJSONProtocolChannel($exec_channel);
22
'command' => 'echo phage',
31
'stdout' => "phage\n",
34
"'echo phage' for {$name}");
42
private function agentExpect(PhutilChannel $agent, $expect, $what) {
43
$message = $agent->waitForMessage();
44
$this->assertEqual($expect, $message, $what);