Merge branch '2015.11-develop' into 2016.11
[tine20] / tests / tine20 / Felamimail / Frontend / JsonTest.php
index 3ad3bd7..428c3b7 100644 (file)
@@ -1408,7 +1408,57 @@ IbVx8ZTO7dJRKrg72aFmWTf0uNla7vicAhpiLWobyNYcZbIjrAGDfg==
         $ruleData[0]['enabled'] = 0;
         $this->_sieveTestHelper($ruleData);
     }
-    
+
+    /**
+     * @see 0006222: Keep a copy from mails forwarded to another emailaddress
+     */
+    public function testSetForwardRuleWithCopy()
+    {
+        $ruleData = array(array(
+            'id'            => 1,
+            'action_type'   => Felamimail_Sieve_Rule_Action::REDIRECT,
+            'action_argument' => array(
+                'emails' => 'someaccount@example.org',
+                'copy'   => 1,
+            ),
+            'conjunction'     => 'allof',
+            'conditions'    => array(array(
+                'test'          => Felamimail_Sieve_Rule_Condition::TEST_ADDRESS,
+                'comperator'    => Felamimail_Sieve_Rule_Condition::COMPERATOR_CONTAINS,
+                'header'        => 'From',
+                'key'           => 'info@example.org',
+            )),
+            'enabled'       => 1,
+        ));
+
+        $this->_sieveTestHelper($ruleData);
+    }
+
+    /**
+     * @see 0006222: Keep a copy from mails forwarded to another emailaddress
+     */
+    public function testSetForwardRuleWithoutCopy()
+    {
+        $ruleData = array(array(
+            'id'            => 1,
+            'action_type'   => Felamimail_Sieve_Rule_Action::REDIRECT,
+            'action_argument' => array(
+                'emails' => 'someaccount@example.org',
+                'copy'   => 0,
+            ),
+            'conjunction'     => 'allof',
+            'conditions'    => array(array(
+                'test'          => Felamimail_Sieve_Rule_Condition::TEST_ADDRESS,
+                'comperator'    => Felamimail_Sieve_Rule_Condition::COMPERATOR_CONTAINS,
+                'header'        => 'From',
+                'key'           => 'info@example.org',
+            )),
+            'enabled'       => 1,
+        ));
+
+        $this->_sieveTestHelper($ruleData);
+    }
+
     /**
      * testGetVacationTemplates
      *