summaryrefslogtreecommitdiffstats
path: root/tests/002.phpt
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-01-24 13:21:47 +0100
committerRemi Collet <remi@remirepo.net>2018-01-24 13:21:47 +0100
commit88e8bef6b42bbd1a831e5c8a37e0567251df83bb (patch)
tree04918715f782ef0312e92d21a99dd2096dec5969 /tests/002.phpt
initial work, only PoC for now
Diffstat (limited to 'tests/002.phpt')
-rw-r--r--tests/002.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/002.phpt b/tests/002.phpt
new file mode 100644
index 0000000..513339c
--- /dev/null
+++ b/tests/002.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Check for rpmvercmp function
+--SKIPIF--
+<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
+--FILE--
+<?php
+var_dump(rpmvercmp("1.0", "1.1"));
+var_dump(rpmvercmp("1.1", "1.0"));
+var_dump(rpmvercmp("1.0", "1.0"));
+// Errors
+var_dump(rpmvercmp());
+var_dump(rpmvercmp("a"));
+var_dump(rpmvercmp("a", "b", "c"));
+?>
+Done
+--EXPECT--
+int(-1)
+int(1)
+int(0)
+
+Warning: rpmvercmp() expects exactly 2 parameters, 0 given in /work/GIT/php-rpminfo/tests/002.php on line 6
+NULL
+
+Warning: rpmvercmp() expects exactly 2 parameters, 1 given in /work/GIT/php-rpminfo/tests/002.php on line 7
+NULL
+
+Warning: rpmvercmp() expects exactly 2 parameters, 3 given in /work/GIT/php-rpminfo/tests/002.php on line 8
+NULL
+Done