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

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(16))');
7:
8:
$data = array(
9:     array(
'10''Abc''zxy'),
10:     array(
'20''Def''wvu'),
11:     array(
'30''Ghi''tsr'),
12:     array(
'40''Jkl''qpo'),
13:     array(
'50''Mno''nml'),
14:     array(
'60''Pqr''kji'),
15: );
16:
17:
18:
// Insert using question mark placeholders
19:
$stmt $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
20: foreach (
$data as $row) {
21:     
$stmt->execute($row);
22: }
23:
24: class 
Test {
25:     public 
$id$val$val2;
26: }
27:
28:
$stmt $db->prepare('SELECT * FROM test');
29:
$stmt->setFetchMode(PDO::FETCH_INTO, new Test);
30:
$stmt->execute();
31:
32: foreach(
$stmt as $obj) {
33:     
var_dump($obj);
34: }
35:
36: echo 
"===FAIL===\n";
37:
38: class 
Fail {
39:     protected 
$id;
40:     public 
$val$val2;
41: }
42:
43:
$stmt->setFetchMode(PDO::FETCH_INTO, new Fail);
44:
$stmt->execute();
45:
46: foreach(
$stmt as $obj) {
47:     
var_dump($obj);
48: }
49:
50:
?>
51:

Expected

object(Test)#%d (3) {
  ["id"]=>
  string(2) "10"
  ["val"]=>
  string(3) "Abc"
  ["val2"]=>
  string(3) "zxy"
}
object(Test)#%d (3) {
  ["id"]=>
  string(2) "20"
  ["val"]=>
  string(3) "Def"
  ["val2"]=>
  string(3) "wvu"
}
object(Test)#%d (3) {
  ["id"]=>
  string(2) "30"
  ["val"]=>
  string(3) "Ghi"
  ["val2"]=>
  string(3) "tsr"
}
object(Test)#%d (3) {
  ["id"]=>
  string(2) "40"
  ["val"]=>
  string(3) "Jkl"
  ["val2"]=>
  string(3) "qpo"
}
object(Test)#%d (3) {
  ["id"]=>
  string(2) "50"
  ["val"]=>
  string(3) "Mno"
  ["val2"]=>
  string(3) "nml"
}
object(Test)#%d (3) {
  ["id"]=>
  string(2) "60"
  ["val"]=>
  string(3) "Pqr"
  ["val2"]=>
  string(3) "kji"
}
===FAIL===

Fatal error: Uncaught Error: Cannot access protected property Fail::$id in %spdo_025.php:%d
Stack trace:
#0 {main}
  thrown in %spdo_025.php on line %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:46:41
  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_025.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_025.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:41
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_025.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- object(Test)#%d (3) {
002-   ["id"]=>
003-   string(2) "10"
004-   ["val"]=>
005-   string(3) "Abc"
006-   ["val2"]=>
007-   string(3) "zxy"
008- }
009- object(Test)#%d (3) {
010-   ["id"]=>
011-   string(2) "20"
012-   ["val"]=>
013-   string(3) "Def"
014-   ["val2"]=>
015-   string(3) "wvu"
016- }
017- object(Test)#%d (3) {
018-   ["id"]=>
019-   string(2) "30"
020-   ["val"]=>
021-   string(3) "Ghi"
022-   ["val2"]=>
023-   string(3) "tsr"
024- }
025- object(Test)#%d (3) {
026-   ["id"]=>
027-   string(2) "40"
028-   ["val"]=>
029-   string(3) "Jkl"
030-   ["val2"]=>
031-   string(3) "qpo"
032- }
033- object(Test)#%d (3) {
034-   ["id"]=>
035-   string(2) "50"
036-   ["val"]=>
037-   string(3) "Mno"
038-   ["val2"]=>
039-   string(3) "nml"
040- }
041- object(Test)#%d (3) {
042-   ["id"]=>
043-   string(2) "60"
044-   ["val"]=>
045-   string(3) "Pqr"
046-   ["val2"]=>
047-   string(3) "kji"
048- }
049- ===FAIL===
050- 
051- Fatal error: Uncaught Error: Cannot access protected property Fail::$id in %spdo_025.php:%d
052- Stack trace:
053- #0 {main}
054-   thrown in %spdo_025.php on line %d

 

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

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