diff options
author | Gunnar Wrobel <wrobel@pardus.de> | 2010-04-13 09:43:00 (GMT) |
---|---|---|
committer | Gunnar Wrobel <wrobel@pardus.de> | 2010-04-13 09:43:00 (GMT) |
commit | 08acbbc35b424b434f963b8eca321ed8e3daa40d (patch) | |
tree | 064649944f5ca69045c93a7d4da5c2e4206dfa25 | |
parent | c24d7697447587d4c6719784f477dfcd16ca4f12 (diff) | |
download | kolab-webadmin-08acbbc35b424b434f963b8eca321ed8e3daa40d.tar.gz |
Update testing and fix an upgrade bug with the new forward segment script. Strict testing is no longer possible because we use the old Horde String library.
-rw-r--r-- | lib/KolabAdmin/Sieve/Segment/Forward.php | 8 | ||||
-rw-r--r-- | test/KolabAdmin/AllTests.php | 2 | ||||
-rw-r--r-- | test/KolabAdmin/Autoload.php | 4 | ||||
-rw-r--r-- | test/KolabAdmin/Unit/Sieve/Segment/ForwardTest.php | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/lib/KolabAdmin/Sieve/Segment/Forward.php b/lib/KolabAdmin/Sieve/Segment/Forward.php index 3252b5f..87e2ebb 100644 --- a/lib/KolabAdmin/Sieve/Segment/Forward.php +++ b/lib/KolabAdmin/Sieve/Segment/Forward.php @@ -143,8 +143,14 @@ extends KolabAdmin_Sieve_Segment { if (preg_match('/keep;/s', $script, $regs)) { $this->_keep_on_server = true; - } else { + } else if (preg_match('/stop;/s', $script, $regs)) { + $this->_keep_on_server = false; + } else if (preg_match('/require/s', $script, $regs)) { + // The unused "require" statement provides the information that it + // is an old script variant. $this->_keep_on_server = false; + } else { + $this->_keep_on_server = true; } } }
\ No newline at end of file diff --git a/test/KolabAdmin/AllTests.php b/test/KolabAdmin/AllTests.php index fce7c9d..3757fa5 100644 --- a/test/KolabAdmin/AllTests.php +++ b/test/KolabAdmin/AllTests.php @@ -49,7 +49,7 @@ class KolabAdmin_AllTests public static function suite() { // Catch strict standards - error_reporting(E_ALL | E_STRICT); + //error_reporting(E_ALL | E_STRICT); // Build the suite $suite = new PHPUnit_Framework_TestSuite('KolabAdmin'); diff --git a/test/KolabAdmin/Autoload.php b/test/KolabAdmin/Autoload.php index 60ee9ac..30cf0c2 100644 --- a/test/KolabAdmin/Autoload.php +++ b/test/KolabAdmin/Autoload.php @@ -27,4 +27,6 @@ if (!spl_autoload_functions()) { } /** Catch strict standards */ -error_reporting(E_ALL | E_STRICT); +//error_reporting(E_ALL | E_STRICT); + +require_once 'Horde/String.php';
\ No newline at end of file diff --git a/test/KolabAdmin/Unit/Sieve/Segment/ForwardTest.php b/test/KolabAdmin/Unit/Sieve/Segment/ForwardTest.php index f82cb28..2d698d5 100644 --- a/test/KolabAdmin/Unit/Sieve/Segment/ForwardTest.php +++ b/test/KolabAdmin/Unit/Sieve/Segment/ForwardTest.php @@ -256,7 +256,7 @@ class KolabAdmin_Unit_Sieve_Segment_ForwardTest extends PHPUnit_Framework_TestCa } $script = 'if allof (' . (($active) ? 'true ## forward enabled' : 'false ## forward disabled') . "\r\n" . ') {' . "\r\n" . - $address . (($keep_on_server) ? ' keep;' : '') . "\r\n" . + $address . (($keep_on_server) ? '' : ' stop;') . "\r\n" . '}' . "\r\n"; if (!$active) { $script = preg_replace('/^(.)/m', '#$1', $script); |