Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10582 lgm 1
<?php
2
 
3
class Version_test extends Spark_test_case {
4
 
5
    function test_version()
6
    {
7
        $clines = $this->capture_buffer_lines(function($cli) {
8
            $cli->execute('version'); 
9
        });
10
        $this->assertEquals(array(SPARK_VERSION), $clines);
11
    }
12
 
13
    function test_sources()
14
    {
15
        $clines = $this->capture_buffer_lines(function($cli) {
16
            $cli->execute('sources');
17
        });
18
        $this->assertEquals($this->source_names, $clines);
19
    }
20
 
21
    function test_bad_command()
22
    {
23
        $clines = $this->capture_buffer_lines(function($cli) {
24
            $cli->execute('fake');
25
        });
26
        $this->assertEquals(array(chr(27) . '[1;31m[ ERROR ]' . chr(27) . '[0m Uh-oh!', chr(27) . '[1;31m[ ERROR ]' . chr(27) . '[0m Unknown action: fake'), $clines);
27
    }
28
 
29
    function test_search_empty()
30
    {
31
        $clines = $this->capture_buffer_lines(function($cli) {
32
            $cli->execute('search', array('nothing_found_here'));
33
        });
34
        $this->assertEquals(array(), $clines);
35
    }
36
 
37
}