summaryrefslogtreecommitdiffstats
path: root/tests/003-rpminfo.phpt
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-01-26 11:45:24 +0100
committerRemi Collet <remi@remirepo.net>2018-01-26 11:45:24 +0100
commitbbe4b75381e1330189ddeec5ae6e4057e650808c (patch)
treedad2bd997f2bedf29e8aa4f4a35cbcdc7d76e75f /tests/003-rpminfo.phpt
parent3b842cb8e777be978fb72fbfac7a2e5f2855d19e (diff)
reorg tests
Diffstat (limited to 'tests/003-rpminfo.phpt')
-rw-r--r--tests/003-rpminfo.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/003-rpminfo.phpt b/tests/003-rpminfo.phpt
new file mode 100644
index 0000000..f7cee82
--- /dev/null
+++ b/tests/003-rpminfo.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Check for rpminfo function
+--SKIPIF--
+<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
+--FILE--
+<?php
+var_dump(rpminfo(__DIR__ . "/bidon.rpm"));
+// Errors
+var_dump(rpminfo(__DIR__ . "/missing.rpm"));
+var_dump(rpminfo(__FILE__));
+?>
+Done
+--EXPECTF--
+array(4) {
+ ["Name"]=>
+ string(5) "bidon"
+ ["Version"]=>
+ string(1) "1"
+ ["Release"]=>
+ string(11) "1.fc25.remi"
+ ["Arch"]=>
+ string(6) "x86_64"
+}
+
+Warning: rpminfo(): Can't open '%s/tests/missing.rpm': No such file or directory in %s/003-rpminfo.php on line %d
+bool(false)
+
+Warning: rpminfo(): Can't read '%s/tests/003-rpminfo.php': Argument is not a RPM file in %s/003-rpminfo.php on line %d
+bool(false)
+Done