summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-06-18 15:38:04 +0200
committerRemi Collet <remi@remirepo.net>2021-06-18 15:38:04 +0200
commit0b1615d804c778516c8c9ed458b69d7a70aea5bb (patch)
tree45708027800c113a933652bc7af240cc3cab7150 /tests
parentdf9c1b8603b19d16247965f85b385004ce4a0335 (diff)
raise exception on bad parameter value with PHP 8
and bump version to 0.6
Diffstat (limited to 'tests')
-rw-r--r--tests/012-rpmaddtag.phpt16
-rw-r--r--tests/013-rpmdbsearch-error.phpt16
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/012-rpmaddtag.phpt b/tests/012-rpmaddtag.phpt
new file mode 100644
index 0000000..bf371a4
--- /dev/null
+++ b/tests/012-rpmaddtag.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Check for rpmaddtag parameter check
+--SKIPIF--
+<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
+--FILE--
+<?php
+var_dump(rpmaddtag(RPMTAG_INSTALLTIME));
+try {
+ var_dump(rpmaddtag(-1));
+} catch (ValueError $e) {
+ echo $e->getMessage();
+}
+?>
+--EXPECTF--
+bool(true)
+%A Unkown rpmtag%A
diff --git a/tests/013-rpmdbsearch-error.phpt b/tests/013-rpmdbsearch-error.phpt
new file mode 100644
index 0000000..4a61227
--- /dev/null
+++ b/tests/013-rpmdbsearch-error.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Check for rpmdbinfo function
+--SKIPIF--
+<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
+--FILE--
+<?php
+var_dump(rpmdbsearch('notexists', RPMTAG_NAME));
+try {
+var_dump(rpmdbsearch('notexists', RPMTAG_NAME, 99));
+} catch (ValueError $e) {
+ echo $e->getMessage();
+}
+?>
+--EXPECTF--
+NULL
+%A Unkown rpmmire%A