diff --git a/src/Net.php b/src/Net.php index 3c7c864..87b3e6c 100644 --- a/src/Net.php +++ b/src/Net.php @@ -30,6 +30,7 @@ class Net */ private $methods = [ 'net_version' => [], + 'net_peerCount' => [], ]; /** diff --git a/test/unit/NetTest.php b/test/unit/NetTest.php index 3979b13..41e0d2a 100644 --- a/test/unit/NetTest.php +++ b/test/unit/NetTest.php @@ -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 *