Skip to content

Commit

Permalink
Added submit & sign test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemilano committed Jun 22, 2018
1 parent e08642b commit 05e9a2d
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/functional/Api/Method/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,35 @@ public function testPaymentWithLocalSign()
$this->assertGreaterThan($balances[1]['pre'], $balances[1]['post']);
}

public function testPaymentWithRemoteSign()
{
$balances = [
[
'pre' => $this->getBalance($this->getAcct1Id())
],
[
'pre' => $this->getBalance($this->getAcct2Id())
]
];

$trans = new Transaction($this->getTx(), $this->client);
$trans->submit($this->getAcct1Secret(), false);

$balances[0]['post'] = $this->getBalance($this->getAcct1Id());
$balances[1]['post'] = $this->getBalance($this->getAcct2Id());

$this->assertLessThan($balances[0]['pre'], $balances[0]['post']);
$this->assertGreaterThan($balances[1]['pre'], $balances[1]['post']);
}

private function getTx()
{
return [
'TransactionType' => 'Payment',
'Account' => $this->getAcct1Id(),
'Destination' => $this->getAcct2Id(),
'Amount' => '1000000',
'Fee' => '000012'
'Fee' => '12'
];
}

Expand Down

0 comments on commit 05e9a2d

Please sign in to comment.