com php-src: Add test for oci_set_* error changes: ext/oci8/tests/error_set.phpt
| From: | Anatol Belski | Date: | Wed, 16 Oct 2013 08:28:21 +0000 |
| Subject: | com php-src: Add test for oci_set_* error changes: ext/oci8/tests/error_set.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73535@lists.php.net to get a copy of this message | ||
Commit: f453122b73105cd420cf31a8e188474a567b2ad9
Author: Christopher Jones <sixd@php.net> Fri, 6 Sep 2013 08:14:18 -0700
Committer: Anatol Belski <ab@php.net> Wed, 16 Oct 2013 01:28:21 -0700
Parents: 66db31f5c6cf6f64e3e7cfca8e0adcf4a186b1a4
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f453122b73105cd420cf31a8e188474a567b2ad9
Log:
Add test for oci_set_* error changes
Changed paths:
A ext/oci8/tests/error_set.phpt
Diff:
diff --git a/ext/oci8/tests/error_set.phpt b/ext/oci8/tests/error_set.phpt
new file mode 100644
index 0000000..ad56e8a
--- /dev/null
+++ b/ext/oci8/tests/error_set.phpt
@@ -0,0 +1,72 @@
+--TEST--
+Check oci_set_{action,client_identifier,module_name,client_info} error handling
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
+--FILE--
+<?php
+
+require(dirname(__FILE__).'/connect.inc');
+
+error_reporting(E_ALL);
+ini_set('display_errors', 'Off');
+
+echo "Test 1\n";
+
+// Generates "ORA-24960: the attribute OCI_ATTR_* is greater than the maximum allowable length
of 64"
+$s = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+
+$r = oci_set_action($c, $s);
+var_dump($r);
+$m = oci_error($c);
+echo $m['code'] , "\n";
+
+$r = oci_set_client_identifier($c, $s);
+var_dump($r);
+$m = oci_error($c);
+echo $m['code'] , "\n";
+
+$r = oci_set_module_name($c, $s);
+var_dump($r);
+$m = oci_error($c);
+echo $m['code'] , "\n";
+
+$r = oci_set_client_info($c, $s);
+var_dump($r);
+$m = oci_error($c);
+echo $m['code'] , "\n";
+
+echo "\nTest 2\n";
+$s = "x";
+
+$r = oci_set_action($c, $s);
+var_dump($r);
+
+$r = oci_set_client_identifier($c, $s);
+var_dump($r);
+
+$r = oci_set_module_name($c, $s);
+var_dump($r);
+
+$r = oci_set_client_info($c, $s);
+var_dump($r);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Test 1
+bool(false)
+24960
+bool(false)
+24960
+bool(false)
+24960
+bool(false)
+24960
+
+Test 2
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+===DONE===