[Kde-bindings] playground/bindings/phpqt/tests

Thomas Moenicke tm at php-qt.org
Wed Jun 20 10:16:59 UTC 2007


SVN commit 677980 by moenicke:

* added unittest for virtual method calls

CCMAIL: kde-bindings at kde.org



 M  +31 -0     QtBasicTestCase.php  


--- trunk/playground/bindings/phpqt/tests/QtBasicTestCase.php #677979:677980
@@ -49,6 +49,20 @@
 	
     }
 
+    class myWidget extends QWidget
+    {
+	public function __construct()
+	{
+	    parent::__construct();
+	}
+	
+	public function sizeHint()
+	{
+	  echo ".";
+	    return parent::sizeHint();
+	}
+	
+    }
 
 
     class QtBasicTestCase extends PHPUnit_Framework_TestCase {
@@ -236,6 +250,23 @@
 	    echo " passed";
 	}
 
+      function testVirtualMethodCall()
+      {
+	echo "\ntesting virtual method call 'sizeHint()' in a loop: ";
+	$argc=1;
+	$argv=array("argv");
+	$app = new QApplication($argc, $argv);
+    
+	$m = new myWidget();
+    
+	for( $i = 0; $i < 10; $i++ )
+	  {
+	    $m->show();
+	    $m->hide();
+	  }
+	echo " passed";
+      }
+
     }    
     
 ?>
\ No newline at end of file



More information about the Kde-bindings mailing list