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_005.phpt ('OCI PDO Common: PDO::FETCH_CLASS')

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:
$db PDOTest::factory();
5:
6:
$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(10))');
7:
$db->exec("INSERT INTO test VALUES(1, 'A', 'AA')");
8:
$db->exec("INSERT INTO test VALUES(2, 'B', 'BB')");
9:
$db->exec("INSERT INTO test VALUES(3, 'C', 'CC')");
10:
11:
$stmt $db->prepare('SELECT id, val, val2 from test');
12:
13: class 
TestBase
14:
{
15:     public 
$id;
16:     protected 
$val;
17:     private 
$val2;
18: }
19:
20: class 
TestDerived extends TestBase
21:
{
22:     protected 
$row;
23:
24:     public function 
__construct(&$row)
25:     {
26:         echo 
__METHOD__ "($row,{$this->id})\n";
27:         
$this->row $row++;
28:     }
29: }
30:
31:
$stmt->execute();
32:
var_dump($stmt->fetchAll(PDO::FETCH_CLASS));
33:
34:
$stmt->execute();
35:
var_dump($stmt->fetchAll(PDO::FETCH_CLASS'TestBase'));
36:
37:
$stmt->execute();
38:
var_dump($stmt->fetchAll(PDO::FETCH_CLASS'TestDerived', array(0)));
39:
40:
?>
41:

Expected

array(3) {
  [0]=>
  object(stdClass)#%d (3) {
    ["id"]=>
    string(1) "1"
    ["val"]=>
    string(1) "A"
    ["val2"]=>
    string(2) "AA"
  }
  [1]=>
  object(stdClass)#%d (3) {
    ["id"]=>
    string(1) "2"
    ["val"]=>
    string(1) "B"
    ["val2"]=>
    string(2) "BB"
  }
  [2]=>
  object(stdClass)#%d (3) {
    ["id"]=>
    string(1) "3"
    ["val"]=>
    string(1) "C"
    ["val2"]=>
    string(2) "CC"
  }
}
array(3) {
  [0]=>
  object(TestBase)#%d (3) {
    ["id"]=>
    string(1) "1"
    ["val":protected]=>
    string(1) "A"
    ["val2":"TestBase":private]=>
    string(2) "AA"
  }
  [1]=>
  object(TestBase)#%d (3) {
    ["id"]=>
    string(1) "2"
    ["val":protected]=>
    string(1) "B"
    ["val2":"TestBase":private]=>
    string(2) "BB"
  }
  [2]=>
  object(TestBase)#%d (3) {
    ["id"]=>
    string(1) "3"
    ["val":protected]=>
    string(1) "C"
    ["val2":"TestBase":private]=>
    string(2) "CC"
  }
}
TestDerived::__construct(0,1)
TestDerived::__construct(1,2)
TestDerived::__construct(2,3)
array(3) {
  [0]=>
  object(TestDerived)#%d (5) {
    ["row":protected]=>
    int(0)
    ["id"]=>
    string(1) "1"
    ["val":protected]=>
    string(1) "A"
    ["val2":"TestBase":private]=>
    NULL
    ["val2"]=>
    string(2) "AA"
  }
  [1]=>
  object(TestDerived)#%d (5) {
    ["row":protected]=>
    int(1)
    ["id"]=>
    string(1) "2"
    ["val":protected]=>
    string(1) "B"
    ["val2":"TestBase":private]=>
    NULL
    ["val2"]=>
    string(2) "BB"
  }
  [2]=>
  object(TestDerived)#%d (5) {
    ["row":protected]=>
    int(2)
    ["id"]=>
    string(1) "3"
    ["val":protected]=>
    string(1) "C"
    ["val2":"TestBase":private]=>
    NULL
    ["val2"]=>
    string(2) "CC"
  }
}

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:42:20
  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_005.php(4): PDOTest::factory()
#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_005.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:42:20
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_005.php(4): PDOTest::factory()
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- array(3) {
002-   [0]=>
003-   object(stdClass)#%d (3) {
004-     ["id"]=>
005-     string(1) "1"
006-     ["val"]=>
007-     string(1) "A"
008-     ["val2"]=>
009-     string(2) "AA"
010-   }
011-   [1]=>
012-   object(stdClass)#%d (3) {
013-     ["id"]=>
014-     string(1) "2"
015-     ["val"]=>
016-     string(1) "B"
017-     ["val2"]=>
018-     string(2) "BB"
019-   }
020-   [2]=>
021-   object(stdClass)#%d (3) {
022-     ["id"]=>
023-     string(1) "3"
024-     ["val"]=>
025-     string(1) "C"
026-     ["val2"]=>
027-     string(2) "CC"
028-   }
029- }
030- array(3) {
031-   [0]=>
032-   object(TestBase)#%d (3) {
033-     ["id"]=>
034-     string(1) "1"
035-     ["val":protected]=>
036-     string(1) "A"
037-     ["val2":"TestBase":private]=>
038-     string(2) "AA"
039-   }
040-   [1]=>
041-   object(TestBase)#%d (3) {
042-     ["id"]=>
043-     string(1) "2"
044-     ["val":protected]=>
045-     string(1) "B"
046-     ["val2":"TestBase":private]=>
047-     string(2) "BB"
048-   }
049-   [2]=>
050-   object(TestBase)#%d (3) {
051-     ["id"]=>
052-     string(1) "3"
053-     ["val":protected]=>
054-     string(1) "C"
055-     ["val2":"TestBase":private]=>
056-     string(2) "CC"
057-   }
058- }
059- TestDerived::__construct(0,1)
060- TestDerived::__construct(1,2)
061- TestDerived::__construct(2,3)
062- array(3) {
063-   [0]=>
064-   object(TestDerived)#%d (5) {
065-     ["row":protected]=>
066-     int(0)
067-     ["id"]=>
068-     string(1) "1"
069-     ["val":protected]=>
070-     string(1) "A"
071-     ["val2":"TestBase":private]=>
072-     NULL
073-     ["val2"]=>
074-     string(2) "AA"
075-   }
076-   [1]=>
077-   object(TestDerived)#%d (5) {
078-     ["row":protected]=>
079-     int(1)
080-     ["id"]=>
081-     string(1) "2"
082-     ["val":protected]=>
083-     string(1) "B"
084-     ["val2":"TestBase":private]=>
085-     NULL
086-     ["val2"]=>
087-     string(2) "BB"
088-   }
089-   [2]=>
090-   object(TestDerived)#%d (5) {
091-     ["row":protected]=>
092-     int(2)
093-     ["id"]=>
094-     string(1) "3"
095-     ["val":protected]=>
096-     string(1) "C"
097-     ["val2":"TestBase":private]=>
098-     NULL
099-     ["val2"]=>
100-     string(2) "CC"
101-   }
102- }

 

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

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