Passed
Pull Request — master (#99)
by
unknown
13:18
created

SaleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 7
c 3
b 1
f 0
dl 0
loc 17
rs 10
wmc 1
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2020, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\tests\unit\sale;
12
13
use DateTimeImmutable;
14
use DateInterval;
15
use hiqdev\php\billing\sale\Sale;
16
use hiqdev\php\billing\sale\SaleInterface;
17
use hiqdev\php\billing\sale\SaleRepositoryInterface;
18
use hiqdev\php\billing\tests\support\sale\SimpleSaleRepository;
19
use hiqdev\php\billing\tests\unit\plan\PlanTest;
20
21
class SaleTest extends PlanTest
22
{
23
    protected DateTimeImmutable $time;
24
25
    protected SaleInterface $sale;
26
27
    protected SaleRepositoryInterface $repository;
28
29
    protected function setUp(): void
30
    {
31
        parent::setUp();
32
        $this->time = new DateTimeImmutable('now');
33
        $this->sale = new Sale(null, $this->plan->verisign, $this->plan->customer, $this->plan, $this->time->sub(new DateInterval('PT1M')));
34
        $this->repository = new SimpleSaleRepository($this->sale);
35
    }
36
}
37