58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Test\Unit;
|
|
|
|
use RuntimeException;
|
|
use Test\TestCase;
|
|
use Web3\Providers\HttpProvider;
|
|
use Web3\RequestManagers\RequestManager;
|
|
use Web3\RequestManagers\HttpRequestManager;
|
|
|
|
class NetTest extends TestCase
|
|
{
|
|
/**
|
|
* net
|
|
*
|
|
* @var Web3\Net
|
|
*/
|
|
protected $net;
|
|
|
|
/**
|
|
* setUp
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->net = $this->web3->net;
|
|
}
|
|
|
|
/**
|
|
* testInstance
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testInstance()
|
|
{
|
|
$net = $this->net;
|
|
|
|
$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');
|
|
}
|
|
} |