From 1cc89bc04c424c0aa43319ddef1e6334a33ad54c Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Mon, 18 Dec 2017 11:50:03 +0800 Subject: [PATCH] net test batch --- test/unit/NetTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/unit/NetTest.php b/test/unit/NetTest.php index 54304c2..5b0b283 100644 --- a/test/unit/NetTest.php +++ b/test/unit/NetTest.php @@ -89,6 +89,28 @@ class NetTest extends TestCase }); } + /** + * testBatch + * + * @return void + */ + public function testBatch() + { + $net = $this->net; + + $net->batch(true); + $net->version(); + $net->listening(); + + $net->provider->execute(function ($err, $data) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + $this->assertTrue(is_string($data[0]->result)); + $this->assertTrue(is_bool($data[1]->result)); + }); + } + /** * testUnallowedMethod *