Passed
Push — master ( 6ae125...ae3d7a )
by Dmitry
02:46
created

AggregatorTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace hiqdev\billing\hiapi\tests\unit\charge;
4
5
use hiqdev\billing\hiapi\charge\Aggregator;
6
use hiqdev\billing\hiapi\charge\Generalizer;
7
use hiqdev\billing\hiapi\type\TypeSemantics;
8
use hiqdev\php\billing\action\Action;
9
use hiqdev\php\billing\order\Order;
10
use hiqdev\php\billing\target\Target;
11
use hiqdev\php\billing\type\Type;
12
use hiqdev\php\units\Quantity;
13
14
class AggregatorTest extends \hiqdev\php\billing\tests\unit\charge\AggregatorTest
15
{
16
    /** @var Aggregator */
17
    protected $aggregator;
18
19
    public function setUp()
20
    {
21
        parent::setUp();
22
23
        $this->aggregator = new Aggregator(new Generalizer(new TypeSemantics()), new TypeSemantics());
24
    }
25
26
    public function testMonthlyChargesQuantityIsNotSummarized()
27
    {
28
        $this->markTestIncomplete('Test is strictly bound to certificate plan. TODO: implement for server');
29
        $actions = [
30
           new Action(
31
               null,
32
               new Type(null, 'monthly,monthly'),
33
               new Target(Target::ANY, 'server'),
34
               Quantity::items(0.25),
35
               $this->plan->customer,
36
               new \DateTimeImmutable()
37
           ),
38
           new Action(
39
               null,
40
               new Type(null, 'monthly,monthly'),
41
               new Target(Target::ANY, 'server'),
42
               Quantity::items(1),
43
               $this->plan->customer,
44
               new \DateTimeImmutable()
45
           ),
46
        ];
47
48
        $order = new Order(null, $this->plan->customer, $actions);
49
        $charges = $this->calculator->calculateCharges($order);
0 ignored issues
show
Unused Code introduced by
The assignment to $charges is dead and can be removed.
Loading history...
50
51
        // TODO: aggregate bills from charges
52
        // TODO: Check bill quantity is not summarized
53
    }
54
}
55