Passed
Pull Request — master (#78)
by
unknown
14:55
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
    /**
24
     * @var Sale|SaleInterface
25
     */
26
    protected $sale;
27
    /**
28
     * @var SaleRepositoryInterface|SimpleSaleRepository
29
     */
30
    protected $repository;
31
32
    protected function setUp(): void
33
    {
34
        parent::setUp();
35
        $this->time = new DateTimeImmutable('now');
36
        $this->sale = new Sale(null, $this->plan->verisign, $this->plan->customer, $this->plan, $this->time->sub(new DateInterval('PT1M')));
37
        $this->repository = new SimpleSaleRepository($this->sale);
38
    }
39
}
40