colly_wyx
2018-05-18 8ef7650be0363908b675827e732ec52fbb996900
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
 * PhpUnderControl_DomainUser_Test
 *
 * 针对 ./Demo/Domain/User.php Domain_User 类的PHPUnit单元测试
 *
 * @author: dogstar 20150208
 */
 
require_once dirname(__FILE__) . '/../test_env.php';
 
if (!class_exists('Domain_User')) {
    require dirname(__FILE__) . '/./Demo/Domain/User.php';
}
 
class PhpUnderControl_DomainUser_Test extends PHPUnit_Framework_TestCase
{
    public $domainUser;
 
    protected function setUp()
    {
        parent::setUp();
 
        $this->domainUser = new Domain_User();
    }
 
    protected function tearDown()
    {
    }
 
 
    /**
     * @group testGetBaseInfo
     */ 
    public function testGetBaseInfo()
    {
        $userId = '1';
 
        $rs = $this->domainUser->getBaseInfo($userId);
 
        $this->assertArrayHasKey('id', $rs);
        $this->assertArrayHasKey('name', $rs);
        $this->assertArrayHasKey('note', $rs);
 
        $this->assertEquals('dogstar', $rs['name']);
    }
 
}