Author: Tobias Schlitt
Date: 2006-09-24 22:10:57 +0200 (Sun, 24 Sep 2006)
New Revision: 3562

Log:
- Added missing include for ezcConsoleToolsOptionRuleTest.
- Added more test cases.

Modified:
   trunk/ConsoleTools/tests/option_rule_test.php
   trunk/ConsoleTools/tests/suite.php

Modified: trunk/ConsoleTools/tests/option_rule_test.php
===================================================================
--- trunk/ConsoleTools/tests/option_rule_test.php       2006-09-24 16:18:30 UTC 
(rev 3561)
+++ trunk/ConsoleTools/tests/option_rule_test.php       2006-09-24 20:10:57 UTC 
(rev 3562)
@@ -99,14 +99,32 @@
 
         try
         {
-            $rule->values = 23;
+            $rule->nonExistent = 23;
         }
-        catch ( ezcBaseValueException $e )
+        catch ( ezcBasePropertyNotFoundException $e )
         {
             return;
         }
-        $this->fail( "Exception not thrown on invalid value for 
ezcConsoleOptionRule->values." );
+        $this->fail( "Exception not thrown on invalid value for 
ezcConsoleOptionRule->nonExistent." );
     }
+
+    public function testIssetAccessSuccess()
+    {
+        $option = new ezcConsoleOption( "a", "aaa" );
+        $rule = new ezcConsoleOptionRule( $option, array( "a" ) );
+
+        $this->assertTrue( isset( $rule->option ) );
+        $this->assertTrue( isset( $rule->values ) );
+    }
+
+    public function testIssetAccessFailure()
+    {
+        $option = new ezcConsoleOption( "a", "aaa" );
+        $rule = new ezcConsoleOptionRule( $option, array( "a" ) );
+
+        $this->assertFalse( isset( $rule->nonExsistent ) );
+    }
+
 }
 
 ?>

Modified: trunk/ConsoleTools/tests/suite.php
===================================================================
--- trunk/ConsoleTools/tests/suite.php  2006-09-24 16:18:30 UTC (rev 3561)
+++ trunk/ConsoleTools/tests/suite.php  2006-09-24 20:10:57 UTC (rev 3562)
@@ -34,6 +34,10 @@
  */
 require_once 'option_test.php';
 /**
+ * Require test suite for ezcConsoleOptionRule class.
+ */
+require_once 'option_rule_test.php';
+/**
  * Require test suite for ezcConsoleTable class.
  */
 require_once 'table_test.php';

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

Reply via email to