net = $this->web3->net; } /** * testInstance * * @return void */ public function testInstance() { $net = new Net($this->testHost); $this->assertTrue($net->provider instanceof HttpProvider); $this->assertTrue($net->provider->requestManager instanceof RequestManager); } /** * testSetProvider * * @return void */ public function testSetProvider() { $net = $this->net; $requestManager = new HttpRequestManager('http://localhost:8545'); $net->provider = new HttpProvider($requestManager); $this->assertEquals($net->provider->requestManager->host, 'http://localhost:8545'); $net->provider = null; $this->assertEquals($net->provider->requestManager->host, 'http://localhost:8545'); } /** * testCallThrowRuntimeException * * @return void */ public function testCallThrowRuntimeException() { $this->expectException(RuntimeException::class); $net = new Net(null); $net->version(); } }