Passed
Push — bugfix/supesc-135-easycredit-m... ( ed8289...21216f )
by
unknown
03:08
created

EasycreditFilterPaymentMethodTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 13
dl 0
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testEasycreditMethodIsLeftAfterFilter() 0 12 1
A testEasycreditMethodIsNotLeftAfterFilter() 0 12 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEcoTest\Zed\Easycredit;
9
10
/**
11
 * @group SprykerEcoTest
12
 * @group Zed
13
 * @group Easycredit
14
 * @group EasycreditTest
15
 * @group EasycreditFilterPaymentMethodTest
16
 */
17
class EasycreditFilterPaymentMethodTest extends AbstractEasycreditTest
18
{
19
    /**
20
     * @return void
21
     */
22
    public function testEasycreditMethodIsLeftAfterFilter(): void
23
    {
24
        $facade = $this->prepareFacade();
25
26
        $quoteTransfer = $this->prepareQuoteTransfer();
27
        $paymentMethodsTransfer = $this->preparePaymentMethodsTransfer();
28
29
        $quoteTransfer->setTotals($this->prepareTotalsTransfer(static::TOTAL_VALUE_FOR_FILTERED_EASYCREDIT_PAYMENT_METHOD));
30
31
        $paymentMethodsTransfer = $facade->filterPaymentMethods($paymentMethodsTransfer, $quoteTransfer);
32
33
        $this->assertEquals(count($paymentMethodsTransfer->getMethods()), 1);
34
    }
35
36
    /**
37
     * @return void
38
     */
39
    public function testEasycreditMethodIsNotLeftAfterFilter(): void
40
    {
41
        $facade = $this->prepareFacade();
42
43
        $quoteTransfer = $this->prepareQuoteTransfer();
44
        $paymentMethodsTransfer = $this->preparePaymentMethodsTransfer();
45
46
        $quoteTransfer->setTotals($this->prepareTotalsTransfer(static::TOTAL_VALUE_FOR_NOT_FILTERED_EASYCREDIT_PAYMENT_METHOD));
47
48
        $paymentMethodsTransfer = $facade->filterPaymentMethods($paymentMethodsTransfer, $quoteTransfer);
49
50
        $this->assertEquals(count($paymentMethodsTransfer->getMethods()), 0);
51
    }
52
}
53