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

1.1       misho       1: --TEST--
                      2: Bug #42134 (Collection error for invalid collection name)
                      3: --SKIPIF--
                      4: <?php
                      5: $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
                      6: require(dirname(__FILE__).'/skipif.inc');
                      7: ?> 
                      8: --FILE--
                      9: <?php
                     10: 
                     11: require(dirname(__FILE__).'/details.inc');
                     12: 
                     13: // Test collection creation error for normal connection
                     14: 
                     15: if (!empty($dbase)) {
                     16:        $c = oci_connect($user,$password,$dbase);
                     17: }
                     18: else {
                     19:        $c = oci_connect($user,$password);
                     20: }
                     21: 
                     22: $collection = oci_new_collection($c, "ABC");
                     23: if (!$collection) {
                     24:        echo "Normal connection: New Collection error\n";
                     25:        $m = oci_error($c);
                     26:        var_dump($m);
                     27: }
                     28: 
                     29: // Test collection creation error for new connection
                     30: 
                     31: if (!empty($dbase)) {
                     32:        $c = oci_new_connect($user,$password,$dbase);
                     33: }
                     34: else {
                     35:        $c = oci_new_connect($user,$password);
                     36: }
                     37: 
                     38: $collection = oci_new_collection($c, "DEF");
                     39: if (!$collection) {
                     40:        echo "New connection: New Collection error\n";
                     41:        $m = oci_error($c);
                     42:        var_dump($m);
                     43: }
                     44: 
                     45: // Test collection creation error for persistent connection
                     46: 
                     47: if (!empty($dbase)) {
                     48:        $c = oci_pconnect($user,$password,$dbase);
                     49: }
                     50: else {
                     51:        $c = oci_pconnect($user,$password);
                     52: }
                     53: 
                     54: $collection = oci_new_collection($c, "GHI");
                     55: if (!$collection) {
                     56:        echo "Persistent connection: New Collection error\n";
                     57:        $m = oci_error($c);
                     58:        var_dump($m);
                     59: }
                     60: 
                     61: echo "Done\n";
                     62: 
                     63: ?>
                     64: --EXPECTF--
                     65: Warning: oci_new_collection(): OCI-22303: type ""."ABC" not found in %s on line %d
                     66: Normal connection: New Collection error
                     67: array(4) {
                     68:   ["code"]=>
                     69:   int(22303)
                     70:   ["message"]=>
                     71:   string(34) "OCI-22303: type ""."ABC" not found"
                     72:   ["offset"]=>
                     73:   int(0)
                     74:   ["sqltext"]=>
                     75:   string(0) ""
                     76: }
                     77: 
                     78: Warning: oci_new_collection(): OCI-22303: type ""."DEF" not found in %s on line %d
                     79: New connection: New Collection error
                     80: array(4) {
                     81:   ["code"]=>
                     82:   int(22303)
                     83:   ["message"]=>
                     84:   string(34) "OCI-22303: type ""."DEF" not found"
                     85:   ["offset"]=>
                     86:   int(0)
                     87:   ["sqltext"]=>
                     88:   string(0) ""
                     89: }
                     90: 
                     91: Warning: oci_new_collection(): OCI-22303: type ""."GHI" not found in %s on line %d
                     92: Persistent connection: New Collection error
                     93: array(4) {
                     94:   ["code"]=>
                     95:   int(22303)
                     96:   ["message"]=>
                     97:   string(34) "OCI-22303: type ""."GHI" not found"
                     98:   ["offset"]=>
                     99:   int(0)
                    100:   ["sqltext"]=>
                    101:   string(0) ""
                    102: }
                    103: Done

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