summaryrefslogtreecommitdiff
path: root/ext/pgsql/tests/05large_object.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pgsql/tests/05large_object.phpt')
-rw-r--r--ext/pgsql/tests/05large_object.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/pgsql/tests/05large_object.phpt b/ext/pgsql/tests/05large_object.phpt
index 3a4a40eb08..b493edd221 100644
--- a/ext/pgsql/tests/05large_object.phpt
+++ b/ext/pgsql/tests/05large_object.phpt
@@ -68,6 +68,28 @@ if (!file_exists($path . 'php.gif.exported')) {
@unlink($path . 'php.gif.exported');
pg_query($db, 'commit');
+/* invalid OID values */
+try {
+ pg_lo_create(-15);
+} catch (\ValueError $e) {
+ echo $e->getMessage(), \PHP_EOL;
+}
+try {
+ pg_lo_create($db, -15);
+} catch (\ValueError $e) {
+ echo $e->getMessage(), \PHP_EOL;
+}
+try {
+ pg_lo_create('giberrish');
+} catch (\ValueError $e) {
+ echo $e->getMessage(), \PHP_EOL;
+}
+try {
+ pg_lo_create($db, 'giberrish');
+} catch (\ValueError $e) {
+ echo $e->getMessage(), \PHP_EOL;
+}
+
echo "OK";
?>
--EXPECT--
@@ -79,4 +101,8 @@ unlink LO
Test without connection
Test with string oid value
import/export LO
+Invalid OID value passed
+Invalid OID value passed
+Invalid OID value passed
+Invalid OID value passed
OK