PersonalBatchTest
This commit is contained in:
parent
8578a7c1c4
commit
303c14a842
50
test/unit/PersonalBatchTest.php
Normal file
50
test/unit/PersonalBatchTest.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Test\Unit;
|
||||
|
||||
use RuntimeException;
|
||||
use Test\TestCase;
|
||||
|
||||
class PersonalBatchTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* personal
|
||||
*
|
||||
* @var Web3\Personal
|
||||
*/
|
||||
protected $personal;
|
||||
|
||||
/**
|
||||
* setUp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->personal = $this->web3->personal;
|
||||
}
|
||||
|
||||
/**
|
||||
* testBatch
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBatch()
|
||||
{
|
||||
$personal = $this->personal;
|
||||
|
||||
$personal->batch(true);
|
||||
$personal->listAccounts();
|
||||
$personal->newAccount('123456');
|
||||
|
||||
$personal->provider->execute(function ($err, $data) {
|
||||
if ($err !== null) {
|
||||
return $this->assertTrue($err->getCode() === 405);
|
||||
}
|
||||
$this->assertTrue(is_array($data[0]->result));
|
||||
$this->assertTrue(is_string($data[1]->result));
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user