RequestManagerTest

This commit is contained in:
sc0Vu 2017-12-19 11:52:31 +08:00
parent f20839f8de
commit cdce5becf6
2 changed files with 33 additions and 1 deletions

View File

@ -14,6 +14,13 @@ class TestCase extends BaseTestCase
*/
protected $web3;
/**
* testRinkebyHost
*
* @var string
*/
protected $testRinkebyHost = 'https://rinkeby.infura.io/vuethexplore';
/**
* setUp
*
@ -21,7 +28,7 @@ class TestCase extends BaseTestCase
*/
public function setUp()
{
$web3 = new Web3('https://rinkeby.infura.io/vuethexplore');
$web3 = new Web3($this->testRinkebyHost);
$this->web3 = $web3;
}

View File

@ -0,0 +1,25 @@
<?php
namespace Test\Unit;
use Test\TestCase;
use Web3\RequestManagers\RequestManager;
class RequestManagerTest extends TestCase
{
/**
* testSetHost
*
* @return void
*/
public function testSetHost()
{
$requestManager = new RequestManager('http://localhost:8545');
$this->assertEquals($requestManager->host, 'http://localhost:8545');
$requestManager->host = $this->testRinkebyHost;
$this->assertEquals($requestManager->host, 'http://localhost:8545');
}
}