BankWidgetTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createWidget() 0 7 1
A testOutput() 0 9 1
A testBankList() 0 6 1
1
<?php
2
/**
3
 * @link https://github.com/yiiviet/yii2-payment
4
 * @copyright Copyright (c) 2017 Yii Viet
5
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
6
 */
7
8
9
namespace yiiviet\tests\unit\payment;
10
11
use yiiviet\payment\BankWidget;
12
13
/**
14
 * Lớp BankWidgetTest
15
 *
16
 * @author Vuong Minh <[email protected]>
17
 * @since 1.0.3
18
 */
19
abstract class BankWidgetTest extends TestCase
20
{
21
22
    protected function createWidget()
23
    {
24
        return new BankWidget([
25
            'gateway' => $this->gateway,
26
            'name' => 'a'
27
        ]);
28
    }
29
30
    public function testOutput()
31
    {
32
        $output = BankWidget::widget([
33
            'gateway' => $this->gateway,
34
            'name' => 'a'
35
        ]);
36
37
        $this->assertNotEmpty($output);
38
    }
39
40
    public function testBankList()
41
    {
42
        $widget = $this->createWidget();
43
44
        $this->assertNotEmpty($widget->provider->banks());
45
    }
46
47
48
}
49