Completed
Branch master (84d5f3)
by Baldur
10:23
created

TaxResponseTest::testTotalAmount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
namespace LAShowroom\TaxJarBundle\Tests\Model\Response;
4
5
use LAShowroom\TaxJarBundle\Model\Response\TaxResponse;
6
7
class TaxResponseTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testTotalAmount()
10
    {
11
        $response = new \stdClass();
12
        $response->order_total_amount = 1.23;
13
14
        $taxResponse = new TaxResponse($response);
15
        $this->assertEquals(1.23, $taxResponse->getTotalAmount());
16
17
        $response = new \stdClass();
18
        $response->amount = 1.23;
19
20
        $taxResponse = new TaxResponse($response);
21
        $this->assertEquals(1.23, $taxResponse->getTotalAmount());
22
    }
23
24
    public function testFreighTaxable()
25
    {
26
        $response = new \stdClass();
27
        $response->freight_taxable = 1;
28
29
        $taxResponse = new TaxResponse($response);
30
        $this->assertTrue($taxResponse->isFreightTaxable());
31
    }
32
33
    public function testTransactionReferenceId()
34
    {
35
        $response = new \stdClass();
36
        $response->transaction_reference_id = 'doge';
37
38
        $taxResponse = new TaxResponse($response);
39
        $this->assertEquals('doge', $taxResponse->getTransactionReferenceId());
40
    }
41
}
42