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