Author: kn
Date: Tue Nov 27 13:08:07 2007
New Revision: 6830

Log:
- Test for drivers __set-method

Modified:
    trunk/Graph/src/interfaces/driver.php
    trunk/Graph/tests/driver_options_test.php

Modified: trunk/Graph/src/interfaces/driver.php
==============================================================================
--- trunk/Graph/src/interfaces/driver.php [iso-8859-1] (original)
+++ trunk/Graph/src/interfaces/driver.php [iso-8859-1] Tue Nov 27 13:08:07 2007
@@ -55,6 +55,8 @@
                 {
                     throw new ezcBaseValueException( "options", 
$propertyValue, "instanceof ezcGraphOptions" );
                 }
+                break;
+
             default:
                 throw new ezcBasePropertyNotFoundException( $propertyName );
                 break;

Modified: trunk/Graph/tests/driver_options_test.php
==============================================================================
--- trunk/Graph/tests/driver_options_test.php [iso-8859-1] (original)
+++ trunk/Graph/tests/driver_options_test.php [iso-8859-1] Tue Nov 27 13:08:07 
2007
@@ -23,6 +23,51 @@
                return new PHPUnit_Framework_TestSuite( 
"ezcGraphDriverOptionsTest" );
        }
 
+    public function testDriverOptionsProperty()
+    {
+        $driver = new ezcGraphSvgDriver();
+
+        $this->assertEquals(
+            new ezcGraphSvgDriverOptions(),
+            $driver->options,
+            'Wrong default value for property options in class 
ezcGraphSvgDriver'
+        );
+
+        $driver->options = new ezcGraphFlashDriverOptions();
+        $this->assertEquals(
+            new ezcGraphFlashDriverOptions(),
+            $driver->options,
+            'Setting property value did not work for property options in class 
ezcGraphSvgDriver'
+        );
+
+        try
+        {
+            $driver->options = false;
+        }
+        catch ( ezcBaseValueException $e )
+        {
+            return true;
+        }
+
+        $this->fail( 'Expected ezcBaseValueException.' );
+    }
+
+    public function testDriverUnknownProperty()
+    {
+        $driver = new ezcGraphSvgDriver();
+
+        try
+        {
+            $driver->unknownProperty = false;
+        }
+        catch ( ezcBasePropertyNotFoundException $e )
+        {
+            return true;
+        }
+
+        $this->fail( 'Expected ezcBasePropertyNotFoundException.' );
+    }
+
     public function testDriverOptionsPropertyWidth()
     {
         $options = new ezcGraphSvgDriverOptions();


-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to