cvs: php-src /ext/mysqli/tests bug38003.phpt
| From: | Antony Dovgal | Date: | Wed, 05 Jul 2006 14:12:41 +0000 |
| Subject: | cvs: php-src /ext/mysqli/tests bug38003.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-39052@lists.php.net to get a copy of this message | ||
tony2001 Wed Jul 5 14:12:41 2006 UTC
Modified files:
/php-src/ext/mysqli/tests bug38003.phpt
Log:
add test
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug38003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/mysqli/tests/bug38003.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug38003.phpt:1.2
--- /dev/null Wed Jul 5 14:12:41 2006
+++ php-src/ext/mysqli/tests/bug38003.phpt Wed Jul 5 14:12:41 2006
@@ -0,0 +1,20 @@
+--TEST--
+Bug #38003 (in classes inherited from MySQLi it's possible to call private constructors from
invalid context)
+--SKIPIF--
+<?php if (!extension_loaded("mysqli")) print "skip"; ?>
+--FILE--
+<?php
+
+class DB extends mysqli {
+
+ private function __construct($hostname, $username, $password, $database) {
+ var_dump("DB::__construct() called");
+ }
+}
+
+$DB = new DB();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to private DB::__construct() from invalid context in %s on line %d