Code Duplication    Length = 7-7 lines in 2 locations

tests/unit/charge/AggregatorTest.php 1 location

@@ 31-37 (lines=7) @@
28
        $this->calculator = new Calculator($this->repository);
29
        $this->aggregator = new Aggregator();
30
        $actions = [];
31
        foreach ($this->plan->types as $type) {
32
            foreach ($this->plan->targets as $target) {
33
                foreach ([1, 2, 3] as $years) {
34
                    $actions[] = new SimpleAction(null, $type, $target, Quantity::year($years), $this->plan->customer);
35
                }
36
            }
37
        }
38
        $this->order = new Order(null, $this->plan->customer, $actions);
39
    }
40

tests/unit/order/CalculatorTest.php 1 location

@@ 28-34 (lines=7) @@
25
        $this->repository = new SimplePlanRepository($this->plan);
26
        $this->calculator = new Calculator($this->repository);
27
        $actions = [];
28
        foreach ($this->plan->types as $type) {
29
            foreach ($this->plan->targets as $target) {
30
                foreach ([1, 2, 3] as $years) {
31
                    $actions[] = new SimpleAction(null, $type, $target, Quantity::year($years));
32
                }
33
            }
34
        }
35
        $this->order = new Order(null, $this->plan->customer, $actions);
36
    }
37