Completed
Push — master ( cbae82...6b14db )
by Andrii
02:38
created

SinglePriceTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 1
A tearDown() 0 3 1
A testCalculateUsage() 0 4 1
1
<?php
2
3
namespace hiqdev\php\billing\tests\unit;
4
5
use hiqdev\php\billing\SinglePrice;
6
use hiqdev\php\billing\Target;
7
use hiqdev\php\billing\Type;
8
use hiqdev\php\units\Quantity;
9
use Money\Money;
10
11
/**
12
 * @author Andrii Vasyliev <[email protected]>
13
 */
14
class SinglePriceTest extends \PHPUnit\Framework\TestCase
15
{
16
    /**
17
     * @var SinglePrice
18
     */
19
    protected $price;
20
21
    /**
22
     * @var SimpleAction
23
     */
24
    protected $action;
25
26
    /**
27
     * @var Money
28
     */
29
    protected $money;
30
31
    protected function setUp()
32
    {
33
        $this->target   = new Target('server', 1);
34
        $this->type     = new Type('server_traf');
35
        $this->quantity = Quantity::gigabyte(10);
36
        $this->money    = Money::USD(15);
37
        $this->price    = new SinglePrice($this->target, $this->type, $this->quantity, $this->money);
38
    }
39
40
    protected function tearDown()
41
    {
42
    }
43
44
    public function testCalculateUsage()
45
    {
46
        $this->assertNull($this->price->calculateUsage(Quantity::byte(1)));
47
    }
48
}
49