PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_oci/tests/pdo_023.phpt ('OCI PDO Common: extending PDO')

Script

1: <?php
2:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
3: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4:
5: class 
PDOStatementX extends PDOStatement
6:
{
7:     public 
$test1 1;
8:     
9:     protected function 
__construct()
10:     {
11:         
$this->test2 2;
12:         
$this->test2 22;
13:         echo 
__METHOD__ "()\n";
14:     }
15:     
16:     function 
__destruct()
17:     {
18:         echo 
__METHOD__ "()\n";
19:     }
20: }
21:
22: class 
PDODatabaseX extends PDO
23:
{
24:     public 
$test1 1;
25:     
26:     function 
__destruct()
27:     {
28:         echo 
__METHOD__ "()\n";
29:     }
30:     
31:     function 
test()
32:     {
33:         
$this->test2 2;
34:         
var_dump($this->test1);
35:         
var_dump($this->test2);
36:         
$this->test2 22;
37:     }
38:     
39:     function 
query($sql)
40:     {
41:         echo 
__METHOD__ "()\n";
42:         
$stmt parent::prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx')));
43:         
$stmt->execute();
44:         return 
$stmt;
45:     }
46: }
47:
48:
$db PDOTest::factory('PDODatabaseX');
49:
$db->test();
50:
var_dump($db);
51:
52:
$db->query('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10))');
53:
$db->query('INSERT INTO test VALUES(0, \'A\')');
54:
$db->query('INSERT INTO test VALUES(1, \'B\')');
55:
56:
57:
$stmt $db->query('SELECT val, id FROM test');
58:
var_dump($stmt);
59:
var_dump($stmt->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE));
60:
61:
$stmt NULL;
62:
$db NULL;
63:
64:
65:
?>
66:

Expected

int(1)
int(2)
object(PDODatabaseX)#%d (2) {
  ["test1"]=>
  int(1)
  ["test2"]=>
  int(22)
}
PDODatabaseX::query()
PDOStatementX::__construct()
PDOStatementX::__destruct()
PDODatabaseX::query()
PDOStatementX::__construct()
PDOStatementX::__destruct()
PDODatabaseX::query()
PDOStatementX::__construct()
PDOStatementX::__destruct()
PDODatabaseX::query()
PDOStatementX::__construct()
object(PDOStatementX)#%d (3) {
  ["test1"]=>
  int(1)
  ["queryString"]=>
  string(24) "SELECT val, id FROM test"
  ["test2"]=>
  int(22)
}
array(2) {
  ["A"]=>
  string(1) "0"
  ["B"]=>
  string(1) "1"
}
PDOStatementX::__destruct()
PDODatabaseX::__destruct()

Output

***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 09:46:12
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12541: TNS:no listener
 (/var/php_gcov/PHP_HEAD/ext/pdo_oci/oci_driver.c:634) in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc:35
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc(35): PDO->__construct('oci:dbname=//lo...', 'system', 'oracle', NULL)
#1 /var/php_gcov/PHP_HEAD/ext/pdo_oci/tests/pdo_023.php(48): PDOTest::factory('PDODatabaseX')
#2 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc on line 35
    nt secondary err code: 111
    nt OS err code: 0

Diff

# original source file: ext/pdo/tests/pdo_023.phpt
001+ ***********************************************************************
002+ Fatal NI connect error 12541, connecting to:
003+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
004+ 
005+   VERSION INFORMATION:
006+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
007+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
008+   Time: 17-JUN-2018 09:46:12
009+   Tracing not turned on.
010+   Tns error struct:
011+     ns main err code: 12541
012+     TNS-12541: TNS:no listener
013+     ns secondary err code: 12560
014+     nt main err code: 511
015+     TNS-00511: No listener
016+ 
017+ Fatal error: Uncaught PDOException: SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12541: TNS:no listener
018+  (/var/php_gcov/PHP_HEAD/ext/pdo_oci/oci_driver.c:634) in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc:35
019+ Stack trace:
020+ #0 /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc(35): PDO->__construct('oci:dbname=//lo...', 'system', 'oracle', NULL)
021+ #1 /var/php_gcov/PHP_HEAD/ext/pdo_oci/tests/pdo_023.php(48): PDOTest::factory('PDODatabaseX')
022+ #2 {main}
023+   thrown in /var/php_gcov/PHP_HEAD/ext/pdo/tests/pdo_test.inc on line 35
024+     nt secondary err code: 111
025+     nt OS err code: 0
001- int(1)
002- int(2)
003- object(PDODatabaseX)#%d (2) {
004-   ["test1"]=>
005-   int(1)
006-   ["test2"]=>
007-   int(22)
008- }
009- PDODatabaseX::query()
010- PDOStatementX::__construct()
011- PDOStatementX::__destruct()
012- PDODatabaseX::query()
013- PDOStatementX::__construct()
014- PDOStatementX::__destruct()
015- PDODatabaseX::query()
016- PDOStatementX::__construct()
017- PDOStatementX::__destruct()
018- PDODatabaseX::query()
019- PDOStatementX::__construct()
020- object(PDOStatementX)#%d (3) {
021-   ["test1"]=>
022-   int(1)
023-   ["queryString"]=>
024-   string(24) "SELECT val, id FROM test"
025-   ["test2"]=>
026-   int(22)
027- }
028- array(2) {
029-   ["A"]=>
030-   string(1) "0"
031-   ["B"]=>
032-   string(1) "1"
033- }
034- PDOStatementX::__destruct()
035- PDODatabaseX::__destruct()

 

Generated at Mon, 18 Jun 2018 17:33:50 +0000 (20 hours ago)

Copyright © 2005-2018 The PHP Group
All rights reserved.