summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-03-12 14:45:49 +0100
committerRemi Collet <remi@remirepo.net>2020-03-12 14:45:49 +0100
commitd80ca1bb5098a8ee32c642e28cda591b451d47c5 (patch)
tree90ce30bb8baea3545e4f482eb941beaf7ee42da8 /tests
parent43fd291ac199efdea4addbf3ec45a16dd3962b7f (diff)
fix search for various tags
Diffstat (limited to 'tests')
-rw-r--r--tests/008-rpmdbsearch.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/008-rpmdbsearch.phpt b/tests/008-rpmdbsearch.phpt
index 28357e0..d22a4bd 100644
--- a/tests/008-rpmdbsearch.phpt
+++ b/tests/008-rpmdbsearch.phpt
@@ -4,19 +4,52 @@ Check for rpmdbinfo function
<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
--FILE--
<?php
+echo "Name / glob\n";
$a = rpmdbsearch('php*', RPMTAG_NAME , RPMMIRE_GLOB);
var_dump(count($a) > 1);
+echo "Name / regex\n";
$a = rpmdbsearch('^php', RPMTAG_NAME, RPMMIRE_REGEX);
var_dump(count($a) > 1);
+echo "Installed file\n";
$a = rpmdbsearch(PHP_BINARY, RPMTAG_INSTFILENAMES);
var_dump(count($a) == 1);
+$phprpm = $a[0]['Name'];
+$p = rpmdbinfo($phprpm, 1);
+
+echo "Pkgid\n";
+$a = rpmdbsearch($p[0]['Sigmd5'], RPMTAG_PKGID);
+var_dump($a[0]['Name'] == $phprpm);
+
+echo "Hdrid\n";
+$a = rpmdbsearch($p[0]['Sha1header'], RPMTAG_HDRID);
+var_dump($a[0]['Name'] == $phprpm);
+
+echo "Installtid\n";
+$a = rpmdbsearch($p[0]['Installtid'], RPMTAG_INSTALLTID);
+var_dump(count($a) >= 1);
+
+echo "Version\n";
+$a = rpmdbsearch($p[0]['Version'], RPMTAG_VERSION);
+var_dump(count($a) > 1);
+
?>
Done
--EXPECTF--
+Name / glob
+bool(true)
+Name / regex
+bool(true)
+Installed file
+bool(true)
+Pkgid
+bool(true)
+Hdrid
bool(true)
+Installtid
bool(true)
+Version
bool(true)
Done