net_listening
This commit is contained in:
parent
296d3442e0
commit
b7ad62faaf
@ -31,6 +31,7 @@ class Net
|
||||
private $methods = [
|
||||
'net_version' => [],
|
||||
'net_peerCount' => [],
|
||||
'net_listening' => [],
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -68,6 +68,27 @@ class NetTest extends TestCase
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testListening
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testListening()
|
||||
{
|
||||
$net = $this->net;
|
||||
|
||||
$net->listening(function ($err, $net) {
|
||||
if ($err !== null) {
|
||||
return $this->fail($err->getMessage());
|
||||
}
|
||||
if (isset($net->result)) {
|
||||
$this->assertTrue(is_bool($net->result));
|
||||
} else {
|
||||
$this->fail($net->error->message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testUnallowedMethod
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user