Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
Select version
•
All
Classes
Namespaces
Files
Functions
Variables
Modules
Pages
EthMethodsTest.php
Go to the documentation of this file.
1
<?php
2
namespace
Ethereum
;
3
use
Ethereum\DataType\EthBlockParam
;
4
use
Ethereum\DataType\EthB
;
5
6
12
class
EthMethodsTest
extends
TestEthClient
13
{
14
15
private
$web3;
16
17
18
public
function
__construct
(
19
?
string
$name = null,
20
array $data = [],
21
string
$dataName =
''
22
) {
23
parent::__construct($name, $data, $dataName);
24
$this->web3 =
new
Ethereum
($_ENV[
'SERVER_URL'
]);
25
}
26
31
public
function
test_eth_getBlockByNumber
()
32
{
33
34
$BlockNumber = 13;
35
$x = $this->web3->eth_getBlockByNumber(
new
EthBlockParam
($BlockNumber),
new
EthB
(
true
));
36
$this->assertSame($BlockNumber, $x->number->val());
37
38
}
39
40
}
Ethereum\TestEthClient
Definition:
TestEthClient.php:64
Ethereum\EthMethodsTest\test_eth_getBlockByNumber
test_eth_getBlockByNumber()
Definition:
EthMethodsTest.php:31
Ethereum\EthMethodsTest\__construct
__construct(?string $name=null, array $data=[], string $dataName='')
Definition:
EthMethodsTest.php:18
EthB
EthBlockParam
Ethereum\EthMethodsTest
Definition:
EthMethodsTest.php:12
Ethereum\DataType\EthB
Definition:
EthB.php:10
Ethereum
Definition:
Abi.php:3
Ethereum\DataType\EthBlockParam
Definition:
EthBlockParam.php:11
tests
TestEthClient
Unit
EthMethodsTest.php
Generated by
1.8.13