Annotation of embedaddon/php/ext/oci8/tests/drcp_scope4.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics OFF
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
                      5: --INI--
                      6: oci8.old_oci_close_semantics=0
                      7: --FILE--
                      8: <?php
                      9: 
                     10: require dirname(__FILE__)."/drcp_functions.inc";
                     11: require dirname(__FILE__)."/details.inc";
                     12: 
                     13: // The default expected behavior of this test is different between PHP
                     14: // 5.2 and PHP 5.3
                     15: //
                     16: // In PHP 5.3, the test opens a connection within function1 and
                     17: // updates a table (without committing).  Another connection is opened
                     18: // from function 2, and the table queried.  When function1 ends, the
                     19: // txn is rolled back and hence the updated value will not be
                     20: // reflected in function2.  Use oci8.old_oci_close_semantics=1 to
                     21: // get old behavior
                     22: 
                     23: // Create the table
                     24: $c = oci_new_connect($user,$password,$dbase);
                     25: @drcp_drop_table($c);
                     26: drcp_create_table($c);
                     27: 
                     28: echo "This is with a OCI_PCONNECT\n";
                     29: function1($user,$password,$dbase);
                     30: 
                     31: // Should return the OLD value
                     32: function2($user,$password,$dbase);
                     33: 
                     34: // This is the first scope for the script
                     35: 
                     36: function function1($user,$password,$dbase)
                     37: {
                     38:        var_dump($c = oci_pconnect($user,$password,$dbase));
                     39:        drcp_update_table($c);
                     40: }
                     41: 
                     42: // This is the second scope
                     43: 
                     44: function function2($user,$password,$dbase)
                     45: {
                     46:        var_dump($c = oci_pconnect($user,$password,$dbase));
                     47:        drcp_select_value($c);
                     48: }
                     49: 
                     50: drcp_drop_table($c);
                     51: oci_close($c);
                     52: 
                     53: echo "Done\n";
                     54: 
                     55: ?>
                     56: --EXPECTF--
                     57: This is with a OCI_PCONNECT
                     58: resource(%d) of type (oci8 persistent connection)
                     59: Update done-- DEPT value has been set to NEWDEPT
                     60: resource(%d) of type (oci8 persistent connection)
                     61: The value of DEPT for id 105 is HR
                     62: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>