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

DiscountTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testFixed() 0 4 1
A testGrows() 0 4 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-2018, 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()
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