Author: Raymond Bosman
Date: 2006-06-15 11:15:27 +0200 (Thu, 15 Jun 2006)
New Revision: 3136

Log:
- Fixed bug #8525: ConsoleInput::getHelpTable() exits with a fatal error.

Modified:
   trunk/ConsoleTools/ChangeLog
   trunk/ConsoleTools/src/input.php
   trunk/ConsoleTools/tests/input_test.php

Modified: trunk/ConsoleTools/ChangeLog
===================================================================
--- trunk/ConsoleTools/ChangeLog        2006-06-14 16:05:36 UTC (rev 3135)
+++ trunk/ConsoleTools/ChangeLog        2006-06-15 09:15:27 UTC (rev 3136)
@@ -1,3 +1,5 @@
+- Fixed bug #8525: ConsoleInput::getHelpTable() exits with a fatal error.
+
 1.1 - Monday 12 June 2006
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 

Modified: trunk/ConsoleTools/src/input.php
===================================================================
--- trunk/ConsoleTools/src/input.php    2006-06-14 16:05:36 UTC (rev 3135)
+++ trunk/ConsoleTools/src/input.php    2006-06-15 09:15:27 UTC (rev 3136)
@@ -164,7 +164,7 @@
 
 
     /**
-     * Indecates if an option was submitted, that has the isHelpOption flag 
set.
+     * Indicates if an option was submitted, that has the isHelpOption flag 
set.
      * 
      * @var bool
      */
@@ -636,7 +636,7 @@
      *                                   for, default is all.
      * @return ezcConsoleTable           The filled table.
      */
-    public function getHelpTable( ezcConsoleTable $table, $long = false, array 
$params = null )
+    public function getHelpTable( ezcConsoleTable $table, $long = false, array 
$params = array() )
     {
         $help = $this->getHelp( $long, $params );
         $i = 0;

Modified: trunk/ConsoleTools/tests/input_test.php
===================================================================
--- trunk/ConsoleTools/tests/input_test.php     2006-06-14 16:05:36 UTC (rev 
3135)
+++ trunk/ConsoleTools/tests/input_test.php     2006-06-15 09:15:27 UTC (rev 
3136)
@@ -1050,6 +1050,31 @@
         );
     }
 
+    public function testGetHelpTableDefaultParameters()
+    {
+        $output = new ezcConsoleOutput();
+        
+        $res = new ezcConsoleTable( $output, 80 ); 
+        $res[0][0]->content = '-t / --testing';
+        $res[0][1]->content = 'Sorry, there is no help text available for this 
parameter.';
+                
+        $res[1][0]->content = '-s / --subway';
+        $res[1][1]->content = 'Sorry, there is no help text available for this 
parameter.';
+                
+        $res[2][0]->content = '-y / --yank';
+        $res[2][1]->content = 'Some even more stupid, but somewhat longer long 
describtion.';
+                
+        $res[3][0]->content = '-e / --edit';
+        $res[3][1]->content = 'Sorry, there is no help text available for this 
parameter.';
+                
+        $table = new ezcConsoleTable( $output, 80 );
+        $table = $this->consoleParameter->getHelpTable( $table );
+
+        $this->assertEquals( 11, sizeof( $table ), "Expected 11 elements in 
the generated HelpTable" );
+    }
+
+
+
     public function testGetHelpText()
     {
         $res = <<<EOF

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to