From 0a9b035bee3515e9e395e0df9b624503781068e6 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 10 Nov 2023 08:35:39 +0100 Subject: new function: rpmgetsymlink(string $path, string $name): ?string --- tests/014-stream.phpt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/014-stream.phpt b/tests/014-stream.phpt index 95f815e..69b881e 100644 --- a/tests/014-stream.phpt +++ b/tests/014-stream.phpt @@ -43,6 +43,11 @@ var_dump(trim(file_get_contents($n))); // Existing file var_dump(trim(file_get_contents($foo))); // Hardlink with content var_dump(trim(file_get_contents($bar))); // hardlink without content var_dump(file_get_contents($x)); // Missing file + +echo "+ symlink\n"; +var_dump(rpmgetsymlink(__DIR__ . "/bidon.rpm", "missing")); +var_dump(rpmgetsymlink(__DIR__ . "/bidon.rpm", "/etc/foo.conf")); // not a symlink +var_dump(rpmgetsymlink(__DIR__ . "/bidon.rpm", "/etc/toto.conf")); // symlink ?> Done --EXPECTF-- @@ -85,4 +90,8 @@ string(7) "content" Warning: file_get_contents(%s/bidon.rpm#/usr/share/doc/bidon/MISSING): Failed to open stream: operation failed in %s on line %d bool(false) ++ symlink +NULL +string(0) "" +string(8) "foo.conf" Done -- cgit