summaryrefslogtreecommitdiff
path: root/plugins/managesieve/tests/Parser.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-09-23 22:44:13 +0200
committerThomas Bruederli <thomas@roundcube.net>2012-09-23 22:44:13 +0200
commit0c144b98a417d50b9c073ae3931fdad47390f1f7 (patch)
treee1a94ada7e5e06fc7c21de13dbb3f86f88634ec7 /plugins/managesieve/tests/Parser.php
parent8f098e8dead85b6512ac72b2d805314baec72a2f (diff)
parente695162ef76054050e4181e4d28f28cf1981386b (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'plugins/managesieve/tests/Parser.php')
-rw-r--r--plugins/managesieve/tests/Parser.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/managesieve/tests/Parser.php b/plugins/managesieve/tests/Parser.php
index 00915cc20..2f24870e2 100644
--- a/plugins/managesieve/tests/Parser.php
+++ b/plugins/managesieve/tests/Parser.php
@@ -15,7 +15,15 @@ class Parser extends PHPUnit_Framework_TestCase
*/
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);