File: OutputCli.php

package info (click to toggle)
roundcube 1.6.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 44,868 kB
  • sloc: javascript: 195,588; php: 76,818; sql: 3,150; sh: 2,882; pascal: 1,079; makefile: 234; xml: 93; perl: 73; ansic: 48; python: 21
file content (34 lines) | stat: -rw-r--r-- 748 bytes parent folder | download
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
<?php

namespace Roundcube\Tests\Rcmail;

use Roundcube\Tests\ActionTestCase;

/**
 * Test class to test rcmail_output_cli class
 */
class Rcmail_OutputCli extends ActionTestCase
{
    /**
     * Test show_message() method
     */
    function test_show_message()
    {
        $rcmail = \rcube::get_instance();
        $output = new \rcmail_output_cli();

        ob_start();
        $output->show_message('unknown');
        $out = ob_get_contents();
        ob_end_clean();

        $this->assertSame('[NOTICE] unknown', trim($out));

        ob_start();
        $output->show_message('errortitle', 'error');
        $out = ob_get_contents();
        ob_end_clean();

        $this->assertSame('[ERROR] An error occurred!', trim($out));
    }
}