diff options
Diffstat (limited to 'tests/011-rpmvercmp_error8.phpt')
-rw-r--r-- | tests/011-rpmvercmp_error8.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/011-rpmvercmp_error8.phpt b/tests/011-rpmvercmp_error8.phpt new file mode 100644 index 0000000..3db3564 --- /dev/null +++ b/tests/011-rpmvercmp_error8.phpt @@ -0,0 +1,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 parameters, 0 given +rpmvercmp() expects exactly 2 parameters, 1 given +rpmvercmp() expects exactly 2 parameters, 3 given +Done |