Annotation of embedaddon/php/ext/oci8/tests/drcp_conn_close1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: DRCP: oci_connect() with oci_close() and oci8.old_oci_close_semantics ON
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
! 5: --INI--
! 6: oci8.old_oci_close_semantics=1
! 7: oci8.connection_class=test
! 8: --FILE--
! 9: <?php
! 10:
! 11: require dirname(__FILE__)."/details.inc";
! 12:
! 13: // Test will open a connection
! 14: // Close the connection
! 15: // Open another connection
! 16: // With oci_close() being a no-op, the same conneciton will be returned
! 17:
! 18:
! 19: echo "This is with a OCI_CONNECT\n";
! 20: var_dump($conn1 = oci_connect($user,$password,$dbase));
! 21: $rn1 = (int)$conn1;
! 22: oci_close($conn1);
! 23:
! 24: // Open another connection
! 25:
! 26: var_dump($conn2 = oci_connect($user,$password,$dbase));
! 27: $rn2 = (int)$conn2;
! 28: oci_close($conn2);
! 29:
! 30: // Compare the resource numbers
! 31:
! 32: if ($rn1 === $rn2)
! 33: echo "Both connections share a resource : OK \n";
! 34: else
! 35: echo "Both connections are different : NOT OK \n";
! 36:
! 37: echo "Done\n";
! 38:
! 39: ?>
! 40: --EXPECTF--
! 41: This is with a OCI_CONNECT
! 42: resource(%d) of type (oci8 connection)
! 43: resource(%d) of type (oci8 connection)
! 44: Both connections share a resource : OK
! 45: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>