summaryrefslogtreecommitdiffstats
path: root/tests/011-rpmvercmp_error8.phpt
blob: 443097587317d1d0925b4e42735d628dd45ae7a4 (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
--TEST--
Check for rpmvercmp function
--SKIPIF--
<?php
if (!extension_loaded("rpminfo")) print "skip";
if (PHP_VERSION_ID < 80000) print "skip only for PHP 8";
?>
--FILE--
<?php
try {
	var_dump(rpmvercmp());
} catch (ArgumentCountError $e) {
    echo $e->getMessage(), "\n";
}
try {
	var_dump(rpmvercmp("a"));
} catch (ArgumentCountError $e) {
    echo $e->getMessage(), "\n";
}
try {
	var_dump(rpmvercmp("a", "b", "c"));
} catch (ArgumentCountError $e) {
    echo $e->getMessage(), "\n";
}
?>
Done
--EXPECTF--
rpmvercmp() expects exactly 2 %s, 0 given
rpmvercmp() expects exactly 2 %s, 1 given
rpmvercmp() expects exactly 2 %s, 3 given
Done