Changeset View
Changeset View
Standalone View
Standalone View
src/channel/__tests__/PhutilPHPObjectProtocolChannelTestCase.php
| Show All 39 Lines | public function testCloseSocketWriteChannel() { | ||||
| // However, if the test breaks, that method will hang forever instead of | // However, if the test breaks, that method will hang forever instead of | ||||
| // returning, which would be hard to diagnose. Since the current | // returning, which would be hard to diagnose. Since the current | ||||
| // implementation shuts down the entire channel, just test for that. | // implementation shuts down the entire channel, just test for that. | ||||
| $this->assertFalse($xp->update(), pht('Expected channel to close.')); | $this->assertFalse($xp->update(), pht('Expected channel to close.')); | ||||
| } | } | ||||
| public function testCloseExecWriteChannel() { | public function testCloseExecWriteChannel() { | ||||
| $future = new ExecFuture('cat'); | $bin = $this->getSupportExecutable('cat'); | ||||
| $future = new ExecFuture('php -f %R', $bin); | |||||
| // If this test breaks, we want to explode, not hang forever. | // If this test breaks, we want to explode, not hang forever. | ||||
| $future->setTimeout(5); | $future->setTimeout(5); | ||||
| $exec_channel = new PhutilExecChannel($future); | $exec_channel = new PhutilExecChannel($future); | ||||
| $exec_channel->write('quack'); | $exec_channel->write('quack'); | ||||
| $exec_channel->closeWriteChannel(); | $exec_channel->closeWriteChannel(); | ||||
| Show All 10 Lines | |||||