Completed
Push — master ( a3c7a7...bd72ff )
by Carlos
02:47
created

RegionalTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetCountry() 0 6 1
A testGetProvince() 0 6 1
A testGetCity() 0 12 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: pjxh
6
 * Date: 15-11-1
7
 * Time: 下午5:12
8
 */
9
namespace Test\Data;
10
11
12
use Overtrue\Wechat\Shop\Data\Regional;
13
14
class RegionalTest extends \PHPUnit_Framework_TestCase
15
{
16
    public function testGetCountry()
17
    {
18
        $regional = new Regional();
19
        $data = $regional->getCountry();
20
        $this->assertEquals(array('中国'),$data);
21
    }
22
23
    public function testGetProvince()
24
    {
25
        $regional = new Regional();
26
        $data = $regional->getProvince();
27
        $this->assertTrue(is_array($data));
28
    }
29
30
    public function testGetCity()
31
    {
32
        $regional = new Regional();
33
        $data = $regional->getCity('上海市');
34
        $this->assertEquals(array(array('上海市')),$data);
35
36
        $regional = new Regional();
37
        $data = $regional->getCity('北京市');
38
        $this->assertEquals(array(array('北京市')),$data);
39
40
        return $data;
41
    }
42
}
43