BankWidgetTest::createWidget()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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