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

TaxResponseTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testTotalAmount() 0 14 1
A testFreighTaxable() 0 8 1
A testTransactionReferenceId() 0 8 1
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