colly_wyx
2018-06-14 bef2c06923d3ba6727654f734bb93d5a09855dc5
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
49
50
51
52
53
54
<?php
/**
 * PhpUnderControl_TaskLite_Test
 *
 * 针对 ../Lite.php Task_Lite 类的PHPUnit单元测试
 *
 * @author: dogstar 20150514
 */
 
require_once dirname(__FILE__) . '/test_env.php';
 
if (!class_exists('Task_Lite')) {
    require dirname(__FILE__) . '/../Lite.php';
}
 
class PhpUnderControl_TaskLite_Test extends PHPUnit_Framework_TestCase
{
    public $taskLite;
 
    protected function setUp()
    {
        parent::setUp();
 
        $this->taskLite = new Task_Lite(new Task_MQ_File());
    }
 
    protected function tearDown()
    {
    }
 
 
    /**
     * @group testAdd
     */ 
    public function testAdd()
    {
        $service = 'Demo.Update';
        $params = array (
            'id' => 888
        );
 
        $rs = $this->taskLite->add($service, $params);
        $this->assertTrue($rs);
    }
 
    public function testAddWrong()
    {
        $service = 'Demo';
 
        $rs = $this->taskLite->add($service);
 
        $this->assertFalse($rs);
    }
}