summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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