DiscountTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 6
c 1
b 1
f 0
dl 0
loc 18
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testGrows() 0 3 1
A testFixed() 0 3 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\charge\FixedDiscountTest;
12
13
use hiqdev\php\billing\charge\modifiers\Discount;
14
use hiqdev\php\billing\charge\modifiers\FixedDiscount;
15
use hiqdev\php\billing\charge\modifiers\GrowingDiscount;
16
17
/**
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
class DiscountTest extends \PHPUnit\Framework\TestCase
21
{
22
    protected $discount;
23
24
    protected function setUp(): void
25
    {
26
        parent::setUp();
27
        $this->discount = new Discount();
28
    }
29
30
    public function testFixed()
31
    {
32
        $this->assertInstanceOf(FixedDiscount::class, $this->discount->fixed(2));
33
    }
34
35
    public function testGrows()
36
    {
37
        $this->assertInstanceOf(GrowingDiscount::class, $this->discount->grows(2));
38
    }
39
}
40