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

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 classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)');
7:
$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); 
8:
$db->exec('INSERT INTO classtypes VALUES(1, \'Test1\')'); 
9:
$db->exec('INSERT INTO classtypes VALUES(2, \'Test2\')'); 
10:
$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(10))');
11:
$db->exec('INSERT INTO test VALUES(1, 0, \'A\')'); 
12:
$db->exec('INSERT INTO test VALUES(2, 1, \'B\')'); 
13:
$db->exec('INSERT INTO test VALUES(3, 2, \'C\')'); 
14:
$db->exec('INSERT INTO test VALUES(4, 3, \'D\')'); 
15:
16:
$stmt $db->prepare('SELECT classtypes.name, test.id AS id, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id');
17:
18: class 
Test1
19:
{
20:     public function 
__construct()
21:     {
22:         echo 
__METHOD__ "()\n";
23:     }
24: }
25:
26: class 
Test2
27:
{
28:     public function 
__construct()
29:     {
30:         echo 
__METHOD__ "()\n";
31:     }
32: }
33:
34: class 
Test3
35:
{
36:     public function 
__construct()
37:     {
38:         echo 
__METHOD__ "()\n";
39:     }
40: }
41:
42:
$stmt->execute();
43:
var_dump($stmt->fetchAll(PDO::FETCH_NUM));
44:
45:
$stmt->execute();
46:
var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE'Test3'));
47:
48:
?>
49:

Expected

array(4) {
  [0]=>
  array(3) {
    [0]=>
    string(8) "stdClass"
    [1]=>
    string(1) "1"
    [2]=>
    string(1) "A"
  }
  [1]=>
  array(3) {
    [0]=>
    string(5) "Test1"
    [1]=>
    string(1) "2"
    [2]=>
    string(1) "B"
  }
  [2]=>
  array(3) {
    [0]=>
    string(5) "Test2"
    [1]=>
    string(1) "3"
    [2]=>
    string(1) "C"
  }
  [3]=>
  array(3) {
    [0]=>
    NULL
    [1]=>
    string(1) "4"
    [2]=>
    string(1) "D"
  }
}
Test1::__construct()
Test2::__construct()
Test3::__construct()
array(4) {
  [0]=>
  object(stdClass)#%d (2) {
    ["id"]=>
    string(1) "1"
    ["val"]=>
    string(1) "A"
  }
  [1]=>
  object(Test1)#%d (2) {
    ["id"]=>
    string(1) "2"
    ["val"]=>
    string(1) "B"
  }
  [2]=>
  object(Test2)#%d (2) {
    ["id"]=>
    string(1) "3"
    ["val"]=>
    string(1) "C"
  }
  [3]=>
  object(Test3)#%d (2) {
    ["id"]=>
    string(1) "4"
    ["val"]=>
    string(1) "D"
  }
}

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:43:17
  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_009.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_009.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:43:17
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_009.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(4) {
002-   [0]=>
003-   array(3) {
004-     [0]=>
005-     string(8) "stdClass"
006-     [1]=>
007-     string(1) "1"
008-     [2]=>
009-     string(1) "A"
010-   }
011-   [1]=>
012-   array(3) {
013-     [0]=>
014-     string(5) "Test1"
015-     [1]=>
016-     string(1) "2"
017-     [2]=>
018-     string(1) "B"
019-   }
020-   [2]=>
021-   array(3) {
022-     [0]=>
023-     string(5) "Test2"
024-     [1]=>
025-     string(1) "3"
026-     [2]=>
027-     string(1) "C"
028-   }
029-   [3]=>
030-   array(3) {
031-     [0]=>
032-     NULL
033-     [1]=>
034-     string(1) "4"
035-     [2]=>
036-     string(1) "D"
037-   }
038- }
039- Test1::__construct()
040- Test2::__construct()
041- Test3::__construct()
042- array(4) {
043-   [0]=>
044-   object(stdClass)#%d (2) {
045-     ["id"]=>
046-     string(1) "1"
047-     ["val"]=>
048-     string(1) "A"
049-   }
050-   [1]=>
051-   object(Test1)#%d (2) {
052-     ["id"]=>
053-     string(1) "2"
054-     ["val"]=>
055-     string(1) "B"
056-   }
057-   [2]=>
058-   object(Test2)#%d (2) {
059-     ["id"]=>
060-     string(1) "3"
061-     ["val"]=>
062-     string(1) "C"
063-   }
064-   [3]=>
065-   object(Test3)#%d (2) {
066-     ["id"]=>
067-     string(1) "4"
068-     ["val"]=>
069-     string(1) "D"
070-   }
071- }

 

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

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