Passed
Push — master ( a69358...1a5e7c )
by Monthon
01:25
created

PromptPayTest::testformatAmount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
require __DIR__ . '/../vendor/autoload.php';
4
require_once __DIR__ . '/../src/PromptPay.php';
5
6
/**
7
 * @property vansales\PromptPay PromptPay
8
 */
9
class PromptPayTest extends PHPUnit_Framework_TestCase {
10
11
  private $PromptPay;
12
13
  public function __construct() {
14
    $this->PromptPay = new vansales\PromptPay();
15
  }
16
17
  public function testformatAmount() {
18
19
    $amount = 90.2511;
20
    $result = $this->PromptPay->formatAmount($amount);
21
    $expected = '90.25';
22
    $this->assertEquals($expected, $result);
23
24
    $amount = 90.2561;
25
    $result = $this->PromptPay->formatAmount($amount);
26
    $expected = '90.26';
27
    $this->assertEquals($expected, $result);
28
  }
29
30
}