Completed
Push — master ( efd5b5...1cc014 )
by Andrii
02:16
created

FixedDiscountTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\tests\unit\charge\FixedDiscountTest;
12
13
use hiqdev\php\billing\charge\modifiers\FixedDiscount;
14
use Money\Money;
15
16
/**
17
 * @author Andrii Vasyliev <[email protected]>
18
 */
19
class FixedDiscountTest extends \PHPUnit\Framework\TestCase
20
{
21
    protected function setUp()
22
    {
23
        parent::setUp();
24
    }
25
26
    public function testCreateAbsolute()
27
    {
28
        $dis = new FixedDiscount(Money::USD(10));
29
        $this->assertTrue($dis->isAbsolute());
30
        $this->assertFalse($dis->isRelative());
31
    }
32
33
    public function testCreateRelative()
34
    {
35
        $dis = new FixedDiscount(2);
36
        $this->assertTrue($dis->isRelative());
37
        $this->assertFalse($dis->isAbsolute());
38
    }
39
}
40