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/oci8/tests/xmltype_02.phpt ('Basic XMLType test #2')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table xmltype_02_tab",
9:     
"create table xmltype_02_tab (warehouse_id number, warehouse_spec xmltype)",
10: );
11:
12:
oci8_test_sql_execute($c$stmtarray);
13:
14:
// Run Test
15:
16:
17:
$id 1;
18:
19:
// Delete any current entry
20:
$s oci_parse($c"delete from xmltype_02_tab where warehouse_id = :id");
21:
oci_bind_by_name($s':id'$id);
22:
oci_execute($s);
23:
24:
// XML data to be inserted
25:
$xml =<<<EOF
26:
<?xml version="1.0"?>
27: <Warehouse>
28: <WarehouseId>1</WarehouseId>
29: <WarehouseName>Southlake, Texas</WarehouseName>
30: <Building>Owned</Building>
31: <Area>25000</Area>
32: <Docks>2</Docks>
33: <DockType>Rear load</DockType>
34: <WaterAccess>true</WaterAccess>
35: <RailAccess>N</RailAccess>
36: <Parking>Street</Parking>
37: <VClearance>10</VClearance>
38: </Warehouse>
39:
EOF;
40:
41: echo 
"Test 1 Insert new XML data using a temporary CLOB\n";
42:
$s oci_parse($c
43:     
"insert into xmltype_02_tab (warehouse_id, warehouse_spec) 
44:      values (:id, XMLType(:clob))"
);
45:
oci_bind_by_name($s':id'$id);
46:
$lob oci_new_descriptor($cOCI_D_LOB);
47:
oci_bind_by_name($s':clob'$lob, -1OCI_B_CLOB);
48:
$lob->writeTemporary($xml);
49:
oci_execute($s);
50:
$lob->close();
51:
52:
// Query the row back
53:
$s oci_parse($c'select xmltype.getclobval(warehouse_spec)
54:                     from xmltype_02_tab where warehouse_id = :id'
);
55:
$r oci_bind_by_name($s':id'$id);
56:
oci_execute($s);
57:
$row oci_fetch_array($sOCI_NUM);
58:
59:
var_dump($row);
60:
61: echo 
"Test 2 Manipulate the data using SimpleXML\n";
62:
63:
$sx simplexml_load_string($row[0]->load());
64:
$row[0]->free();
65:
var_dump($sx);
66:
67:
$sx->Docks -= 1;  // change the data
68:
69:
var_dump($sx);
70:
71: echo 
"Test 3: Update changes using a temporary CLOB\n";
72:
73:
$s oci_parse($c'update xmltype_02_tab
74:                     set warehouse_spec = XMLType(:clob)
75:                     where warehouse_id = :id'
);
76:
oci_bind_by_name($s':id'$id);
77:
$lob oci_new_descriptor($cOCI_D_LOB);
78:
oci_bind_by_name($s':clob'$lob, -1OCI_B_CLOB);
79:
$lob->writeTemporary($sx->asXml());
80:
oci_execute($s);
81:
$lob->close();
82:
83:
// Query the changed row back and print it
84:
$s oci_parse($c'select xmltype.getclobval(warehouse_spec)
85:                     from xmltype_02_tab where warehouse_id = :id'
);
86:
$r oci_bind_by_name($s':id'$id);
87:
oci_execute($s);
88:
$row oci_fetch_array($sOCI_NUM);
89:
var_dump($row[0]->load());
90:
$row[0]->free();
91:
92:
// Clean up
93:
94:
$stmtarray = array(
95:     
"drop table xmltype_02_tab"
96:
);
97:
98:
oci8_test_sql_execute($c$stmtarray);
99:
100:
?>
101:
===DONE===
102:

Expected

Test 1 Insert new XML data using a temporary CLOB
array(1) {
  [0]=>
  object(OCI-Lob)#%d (1) {
    ["descriptor"]=>
    resource(%d) of type (oci8 descriptor)
  }
}
Test 2 Manipulate the data using SimpleXML
object(SimpleXMLElement)#%d (10) {
  ["WarehouseId"]=>
  string(1) "1"
  ["WarehouseName"]=>
  string(16) "Southlake, Texas"
  ["Building"]=>
  string(5) "Owned"
  ["Area"]=>
  string(5) "25000"
  ["Docks"]=>
  string(1) "2"
  ["DockType"]=>
  string(9) "Rear load"
  ["WaterAccess"]=>
  string(4) "true"
  ["RailAccess"]=>
  string(1) "N"
  ["Parking"]=>
  string(6) "Street"
  ["VClearance"]=>
  string(2) "10"
}
object(SimpleXMLElement)#%d (10) {
  ["WarehouseId"]=>
  string(1) "1"
  ["WarehouseName"]=>
  string(16) "Southlake, Texas"
  ["Building"]=>
  string(5) "Owned"
  ["Area"]=>
  string(5) "25000"
  ["Docks"]=>
  string(1) "1"
  ["DockType"]=>
  string(9) "Rear load"
  ["WaterAccess"]=>
  string(4) "true"
  ["RailAccess"]=>
  string(1) "N"
  ["Parking"]=>
  string(6) "Street"
  ["VClearance"]=>
  string(2) "10"
}
Test 3: Update changes using a temporary CLOB
string(%d) "<?xml version="1.0"?>
<Warehouse>
%sWarehouseId>1</WarehouseId>
%sWarehouseName>Southlake, Texas</WarehouseName>
%sBuilding>Owned</Building>
%sArea>25000</Area>
%sDocks>1</Docks>
%sDockType>Rear load</DockType>
%sWaterAccess>true</WaterAccess>
%sRailAccess>N</RailAccess>
%sParking>Street</Parking>
%sVClearance>10</VClearance>
</Warehouse>
"
===DONE===

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 06:12:18
  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: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
    nt secondary err code: 111
    nt OS err code: 0

Diff

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 06:12:18
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: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
018+     nt secondary err code: 111
019+     nt OS err code: 0
001- Test 1 Insert new XML data using a temporary CLOB
002- array(1) {
003-   [0]=>
004-   object(OCI-Lob)#%d (1) {
005-     ["descriptor"]=>
006-     resource(%d) of type (oci8 descriptor)
007-   }
008- }
009- Test 2 Manipulate the data using SimpleXML
010- object(SimpleXMLElement)#%d (10) {
011-   ["WarehouseId"]=>
012-   string(1) "1"
013-   ["WarehouseName"]=>
014-   string(16) "Southlake, Texas"
015-   ["Building"]=>
016-   string(5) "Owned"
017-   ["Area"]=>
018-   string(5) "25000"
019-   ["Docks"]=>
020-   string(1) "2"
021-   ["DockType"]=>
022-   string(9) "Rear load"
023-   ["WaterAccess"]=>
024-   string(4) "true"
025-   ["RailAccess"]=>
026-   string(1) "N"
027-   ["Parking"]=>
028-   string(6) "Street"
029-   ["VClearance"]=>
030-   string(2) "10"
031- }
032- object(SimpleXMLElement)#%d (10) {
033-   ["WarehouseId"]=>
034-   string(1) "1"
035-   ["WarehouseName"]=>
036-   string(16) "Southlake, Texas"
037-   ["Building"]=>
038-   string(5) "Owned"
039-   ["Area"]=>
040-   string(5) "25000"
041-   ["Docks"]=>
042-   string(1) "1"
043-   ["DockType"]=>
044-   string(9) "Rear load"
045-   ["WaterAccess"]=>
046-   string(4) "true"
047-   ["RailAccess"]=>
048-   string(1) "N"
049-   ["Parking"]=>
050-   string(6) "Street"
051-   ["VClearance"]=>
052-   string(2) "10"
053- }
054- Test 3: Update changes using a temporary CLOB
055- string(%d) "<?xml version="1.0"?>
056- <Warehouse>
057- %sWarehouseId>1</WarehouseId>
058- %sWarehouseName>Southlake, Texas</WarehouseName>
059- %sBuilding>Owned</Building>
060- %sArea>25000</Area>
061- %sDocks>1</Docks>
062- %sDockType>Rear load</DockType>
063- %sWaterAccess>true</WaterAccess>
064- %sRailAccess>N</RailAccess>
065- %sParking>Street</Parking>
066- %sVClearance>10</VClearance>
067- </Warehouse>
068- "
069- ===DONE===

 

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

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