Aleksander Machniak
2012-09-19 7641e4aaab279e060cf4f4a981869f07f3a02f45
Improve capabilities list handling in parser tests
1 files modified
10 ■■■■■ changed files
plugins/managesieve/tests/Parser.php 10 ●●●●● patch | view | raw | blame | history
plugins/managesieve/tests/Parser.php
@@ -15,7 +15,15 @@
     */
    function test_parser($input, $output, $message)
    {
        $script = new rcube_sieve_script($input);
        // get capabilities list from the script
        $caps = array();
        if (preg_match('/require \[([a-z0-9", ]+)\]/', $input, $m)) {
            foreach (explode(',', $m[1]) as $cap) {
                $caps[] = trim($cap, '" ');
            }
        }
        $script = new rcube_sieve_script($input, $caps);
        $result = $script->as_text();
        $this->assertEquals(trim($result), trim($output), $message);