Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
Select version
•
All
Classes
Namespaces
Files
Functions
Variables
Modules
Pages
SmartContractTest.php
Go to the documentation of this file.
1
<?php
2
namespace
Ethereum
;
3
4
use
Ethereum\DataType\EthQ
;
5
11
class
SmartContractTest
extends
TestEthContract
12
{
13
25
public
function
testSimpleContract
()
26
{
27
$number = 2;
28
$result = $this->contract->multiplyWithSeven(
29
new
EthQ
($number, [
'abi'
=>
'uint256'
])
30
);
31
$this->assertEquals($number*7, $result->val());
32
}
33
34
35
public
function
testSimpleContractUsingAlias
()
36
{
37
$number = 2;
38
$result = $this->contract->multiplyWithSevenUsingAlias(
39
new
EthQ
($number, [
'abi'
=>
'uint256'
])
40
);
41
$this->assertEquals($number*7, $result->val());
42
}
43
44
}
45
46
Ethereum\DataType\EthQ
Definition:
EthQ.php:14
EthQ
Ethereum\TestEthContract
Definition:
TestEthContract.php:66
Ethereum\SmartContractTest
Definition:
SmartContractTest.php:11
Ethereum\SmartContractTest\testSimpleContractUsingAlias
testSimpleContractUsingAlias()
Definition:
SmartContractTest.php:35
Ethereum
Definition:
Abi.php:3
Ethereum\SmartContractTest\testSimpleContract
testSimpleContract()
Definition:
SmartContractTest.php:25
tests
TestEthClient
Unit
SmartContractTest.php
Generated by
1.8.13