web3 = $web3; } /** * testSend * * @return void */ public function testSend() { $eth = $this->web3->eth; $eth->protocolVersion(function ($err, $version) { if ($err !== null) { return $this->fail($err->getMessage()); } if (isset($version->result)) { $this->assertTrue(is_string($version->result)); } else { $this->fail($version->error->message); } }); } /** * testUnallowedMethod * * @return void */ public function testUnallowedMethod() { $this->expectException(RuntimeException::class); $eth = $this->web3->eth; $eth->hello(function ($err, $hello) { if ($err !== null) { return $this->fail($err->getMessage()); } if (isset($hello->result)) { $this->assertTrue(true); } else { $this->fail($hello->error->message); } }); } }