Passed
Branch master (168fd2)
by Dariusz
06:34
created

CartDiscountTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCartDiscount() 0 11 1
1
<?php
2
3
namespace Plane\Shop\Tests;
4
5
use Plane\Shop\Cart;
6
use Plane\Shop\Discount\TotalPriceThresholdDiscount;
7
8
class CartDiscountTest extends \PHPUnit\Framework\TestCase
9
{
10
    public function testCartDiscount()
11
    {
12
        $cart = new Cart('USD');
13
       
14
        $cartDiscount = new TotalPriceThresholdDiscount('Discount description', $cart, [
15
            'treshold' => 14,
16
            'discount' => 0.1
17
        ]);
18
19
        $this->assertSame($cartDiscount->getDescription(), 'Discount description');
20
    }
21
}