Completed
Push — master ( c9eeb2...84d5f3 )
by Baldur
03:47 queued 01:58
created

TaxResponseTest::testTransactionReferenceId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
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