A basic set of options to get other backends than the mock implementation working.
authorGunnar Wrobel <p@rdus.de>
Tue, 14 Dec 2010 15:44:20 +0000 (16:44 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 14 Dec 2010 17:26:59 +0000 (18:26 +0100)
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Cli.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Unit/Cli/OptionsTest.php

index 2c5d832..b3aae1c 100644 (file)
@@ -105,6 +105,22 @@ Choices are:
                     'help'   => Horde_Kolab_Storage_Translation::t('The user accessing the backend.')
                 )
             ),
+            new Horde_Argv_Option(
+                '-p',
+                '--pass',
+                array(
+                    'action' => 'store',
+                    'help'   => Horde_Kolab_Storage_Translation::t('The password of the user accessing the backend.')
+                )
+            ),
+            new Horde_Argv_Option(
+                '-H',
+                '--host',
+                array(
+                    'action' => 'store',
+                    'help'   => Horde_Kolab_Storage_Translation::t('The host that holds the data.')
+                )
+            ),
         );
         $usage = Horde_Kolab_Storage_Translation::t(
             "[options] MODULE ACTION\nPossible MODULEs and ACTIONs:
index 7775aa7..2dcc45e 100644 (file)
@@ -56,4 +56,37 @@ extends Horde_Kolab_Storage_TestCase
             $this->runCli()
         );
     }
+
+    public function testOptionUser()
+    {
+        $_SERVER['argv'] = array(
+            'kolab-storage'
+        );
+        $this->assertRegExp(
+            '/-u[ ]*USER,[ ]*--user=USER/',
+            $this->runCli()
+        );
+    }
+
+    public function testOptionPass()
+    {
+        $_SERVER['argv'] = array(
+            'kolab-storage'
+        );
+        $this->assertRegExp(
+            '/-p[ ]*PASS,[ ]*--pass=PASS/',
+            $this->runCli()
+        );
+    }
+
+    public function testOptionHost()
+    {
+        $_SERVER['argv'] = array(
+            'kolab-storage'
+        );
+        $this->assertRegExp(
+            '/-H[ ]*HOST,[ ]*--host=HOST/',
+            $this->runCli()
+        );
+    }
 }