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

1.1       misho       1: --TEST--
                      2: PECL Bug #16842 (NO_DATA_FOUND exception is a warning)
                      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: --INI--
                      9: error_reporting = E_WARNING
                     10: --FILE--
                     11: <?php
                     12: 
                     13: require(dirname(__FILE__).'/connect.inc');
                     14: 
                     15: // Run Test
                     16: 
                     17: echo "Test 1\n";
                     18: 
                     19: echo "Raises NO_DATA_FOUND\n";
                     20: $s = oci_parse($c, 'begin raise NO_DATA_FOUND; end;');
                     21: $e = oci_execute($s);
                     22: var_dump($e);
                     23: var_dump(oci_error($s));
                     24: 
                     25: echo "Test 2\n";
                     26: 
                     27: echo "Raises ZERO_DIVIDE\n";
                     28: $s = oci_parse($c, 'begin raise ZERO_DIVIDE; end;');
                     29: $e = oci_execute($s);
                     30: var_dump($e);
                     31: var_dump(oci_error($s));
                     32: 
                     33: oci_close($c);
                     34: 
                     35: ?>
                     36: ===DONE===
                     37: <?php exit(0); ?>
                     38: --EXPECTF--
                     39: Test 1
                     40: Raises NO_DATA_FOUND
                     41: 
                     42: Warning: oci_execute(): ORA-01403: %s
                     43: ORA-06512: at line %d in %specl_bug16842.php on line %d
                     44: bool(false)
                     45: array(4) {
                     46:   ["code"]=>
                     47:   int(1403)
                     48:   ["message"]=>
                     49:   string(%d) "ORA-01403: %s
                     50: ORA-06512: at line 1"
                     51:   ["offset"]=>
                     52:   int(0)
                     53:   ["sqltext"]=>
                     54:   string(31) "begin raise NO_DATA_FOUND; end;"
                     55: }
                     56: Test 2
                     57: Raises ZERO_DIVIDE
                     58: 
                     59: Warning: oci_execute(): ORA-01476: %s
                     60: ORA-06512: at line 1 in %s on line 19
                     61: bool(false)
                     62: array(4) {
                     63:   ["code"]=>
                     64:   int(1476)
                     65:   ["message"]=>
                     66:   string(%d) "ORA-01476: %s
                     67: ORA-06512: at line 1"
                     68:   ["offset"]=>
                     69:   int(0)
                     70:   ["sqltext"]=>
                     71:   string(29) "begin raise ZERO_DIVIDE; end;"
                     72: }
                     73: ===DONE===

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