Add Contract tests.
This commit is contained in:
parent
49e19415b3
commit
e9b03bcef4
@ -3,6 +3,9 @@
|
|||||||
namespace Test\Unit;
|
namespace Test\Unit;
|
||||||
|
|
||||||
use Test\TestCase;
|
use Test\TestCase;
|
||||||
|
use Web3\Providers\HttpProvider;
|
||||||
|
use Web3\RequestManagers\RequestManager;
|
||||||
|
use Web3\RequestManagers\HttpRequestManager;
|
||||||
use Web3\Contract;
|
use Web3\Contract;
|
||||||
use Web3\Utils;
|
use Web3\Utils;
|
||||||
use Web3\Contracts\Ethabi;
|
use Web3\Contracts\Ethabi;
|
||||||
@ -423,6 +426,37 @@ class ContractTest extends TestCase
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* testInstance
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testInstance()
|
||||||
|
{
|
||||||
|
$contract = new Contract($this->testHost, $this->testAbi);
|
||||||
|
|
||||||
|
$this->assertTrue($contract->provider instanceof HttpProvider);
|
||||||
|
$this->assertTrue($contract->provider->requestManager instanceof RequestManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* testSetProvider
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testSetProvider()
|
||||||
|
{
|
||||||
|
$contract = $this->contract;
|
||||||
|
$requestManager = new HttpRequestManager('http://localhost:8545');
|
||||||
|
$contract->provider = new HttpProvider($requestManager);
|
||||||
|
|
||||||
|
$this->assertEquals($contract->provider->requestManager->host, 'http://localhost:8545');
|
||||||
|
|
||||||
|
$contract->provider = null;
|
||||||
|
|
||||||
|
$this->assertEquals($contract->provider->requestManager->host, 'http://localhost:8545');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDeploy
|
* testDeploy
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user