Passed
Pull Request — master (#78)
by
unknown
14:55
created

ModifierFactoryTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 9
c 1
b 0
f 1
dl 0
loc 21
rs 10
wmc 3
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\charge\modifiers;
12
13
use hiqdev\php\billing\charge\modifiers\Discount;
14
use hiqdev\php\billing\charge\modifiers\ModifierFactory;
15
16
/**
17
 * @author Andrii Vasyliev <[email protected]>
18
 */
19
class ModifierFactoryTest extends \PHPUnit\Framework\TestCase
20
{
21
    protected $factory;
22
23
    protected function setUp(): void
24
    {
25
        parent::setUp();
26
        $this->factory = new ModifierFactory();
27
    }
28
29
    public function testDiscount()
30
    {
31
        $discount = $this->factory->discount();
32
        $this->assertInstanceOf(Discount::class, $discount);
33
    }
34
35
    public function testNewEveryTime()
36
    {
37
        $one = $this->factory->reason('test');
38
        $two = $this->factory->reason('test');
39
        $this->assertTrue($one !== $two);
40
    }
41
}
42