Skip to content

Commit

Permalink
Add testPeerCountAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0Vu committed Aug 27, 2023
1 parent f46f781 commit 746b4f1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/unit/NetApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@ public function testListening()
});
}

/**
* testPeerCountAsync
*
* @return void
*/
public function testPeerCountAsync()
{
$net = $this->net;
$net->provider = $this->asyncHttpProvider;

// should return reactphp promise
$promise = $net->peerCount(function ($err, $count) {
if ($err !== null) {
return $this->fail($err->getMessage());
}
$this->assertTrue($count instanceof BigNumber);
});
$this->assertTrue($promise instanceof \React\Promise\PromiseInterface);
\React\Async\await($promise);
}

/**
* testUnallowedMethod
*
Expand Down

0 comments on commit 746b4f1

Please sign in to comment.