[pLog-svn] r3726 - plog/trunk/class/config

Oscar Renalias oscar at renalias.net
Sun Jul 16 20:35:51 GMT 2006


I've added two more test cases for this issue and also mantis issue  
978. We should try to commit a test case for each bug that we fix,  
first of all to show that it's fixed but most important, so that we  
can use these tests in the future to make sure that old bugs do not  
reappear. You're probably thinking it's an annoyance to write extra  
code, but it didn't take me more than 10 minutes (5 per case)

There are obviously a few cases where writing test cases is difficult  
(like all UI related stuff) but we should force ourselves to write  
test cases for as many classes as possible. It'd be foolish to write  
now unit test cases for all methods of all classes, but at least we  
should write them as we fix issues or modify/improve classes and  
methods. It's actually not that difficult and you can have a look at  
the test cases already available in the class/test/tests folder, or  
ask for advice :-)

Oscar

On 16 Jul 2006, at 13:03, mark at devel.lifetype.net wrote:

> Author: mark
> Date: 2006-07-16 10:03:02 +0000 (Sun, 16 Jul 2006)
> New Revision: 3726
>
> Modified:
>    plog/trunk/class/config/configdbstorage.class.php
> Log:
> If the config parameter does not exist, we should return the  
> default value. Instead of nothing!!
>
> Modified: plog/trunk/class/config/configdbstorage.class.php
> ===================================================================
> --- plog/trunk/class/config/configdbstorage.class.php	2006-07-16  
> 09:53:02 UTC (rev 3725)
> +++ plog/trunk/class/config/configdbstorage.class.php	2006-07-16  
> 10:03:02 UTC (rev 3726)
> @@ -142,6 +142,8 @@
>                  } else {
>                      return $this->_data[$key];
>                  }
> +            } else {
> +            	return $defaultValue;
>              }
>          }
>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list