laruence                                 Tue, 06 Mar 2012 06:24:50 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=323936

Log:
Add test for bug #61292, bug was fixed in -r323935

Bug: https://bugs.php.net/61292 (Closed) Segfault while calling a method on an 
overloaded PDO object.
      
Changed paths:
    A   php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt
    A   php/php-src/trunk/ext/pdo/tests/bug61292.phpt

Added: php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt                    
        (rev 0)
+++ php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt    2012-03-06 
06:24:50 UTC (rev 323936)
@@ -0,0 +1,36 @@
+--TEST--
+Bug #61292 (Segfault while calling a method on an overloaded PDO object)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) 
putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+
+class Database_SQL extends PDO
+{
+       function __construct()
+       {
+               $options = array(PDO::ATTR_PERSISTENT => TRUE);
+               parent::__construct(getenv("PDOTEST_DSN"), 
getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options);
+       }
+
+       var $bar = array();
+
+       public function foo()
+       {
+               var_dump($this->bar);
+       }
+}
+
+(new Database_SQL)->foo();
+?>
+--EXPECTF--
+array(0) {
+}

Added: php/php-src/trunk/ext/pdo/tests/bug61292.phpt
===================================================================
--- php/php-src/trunk/ext/pdo/tests/bug61292.phpt                               
(rev 0)
+++ php/php-src/trunk/ext/pdo/tests/bug61292.phpt       2012-03-06 06:24:50 UTC 
(rev 323936)
@@ -0,0 +1,36 @@
+--TEST--
+Bug #61292 (Segfault while calling a method on an overloaded PDO object)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) 
putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+
+class Database_SQL extends PDO
+{
+       function __construct()
+       {
+               $options = array(PDO::ATTR_PERSISTENT => TRUE);
+               parent::__construct(getenv("PDOTEST_DSN"), 
getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options);
+       }
+
+       var $bar = array();
+
+       public function foo()
+       {
+               var_dump($this->bar);
+       }
+}
+
+(new Database_SQL)->foo();
+?>
+--EXPECTF--
+array(0) {
+}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to