summaryrefslogtreecommitdiffstats
path: root/tests/007-rpmdbinfo.phpt
blob: c568dd9fc95a584756a27e9434c8afb17175e45c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--TEST--
Check for rpmdbinfo function
--SKIPIF--
<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
--FILE--
<?php 
var_dump(rpmdbinfo('doesntexistsinrpmdb'));
var_dump(rpmdbinfo('bash'));

$k = rpmdbinfo('kernel');
var_dump(count($k) > 0); // multiple kernels
$n = $k[0]['Name'] . '-' . $k[0]['Version'] . '-'  . $k[0]['Release'];

$k = rpmdbinfo($n); // single kernel with NEVR
var_dump(count($k) ==1);

?>
Done
--EXPECTF--
bool(false)
array(1) {
  [0]=>
  array(5) {
    ["Name"]=>
    string(4) "bash"
    ["Version"]=>
    string(%d) "%s"
    ["Release"]=>
    string(%d) "%s"
    ["Summary"]=>
    string(26) "The GNU Bourne Again shell"
    ["Arch"]=>
    string(%d) "%s"
  }
}
bool(true)
bool(true)
Done