summaryrefslogtreecommitdiffstats
path: root/tests/014-stream.phpt
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-10-19 12:29:15 +0200
committerRemi Collet <remi@php.net>2023-10-19 12:29:15 +0200
commitba8ff7f35e870a10bb0bd68b3ba0ec9ab43b8576 (patch)
tree0a38423c990da74801d436d30f5419c86f86e38b /tests/014-stream.phpt
parent50e5316d5a3cff209d9686340d0ffe47c422c762 (diff)
add symlink
Diffstat (limited to 'tests/014-stream.phpt')
-rw-r--r--tests/014-stream.phpt27
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/014-stream.phpt b/tests/014-stream.phpt
index 37b41dd..95f815e 100644
--- a/tests/014-stream.phpt
+++ b/tests/014-stream.phpt
@@ -12,17 +12,21 @@ $n = "rpm://" . __DIR__ . "/bidon.rpm#/usr/share/doc/bidon/README";
$x = "rpm://" . __DIR__ . "/bidon.rpm#/usr/share/doc/bidon/MISSING";
$foo = "rpm://" . __DIR__ . "/bidon.rpm#/etc/foo.conf";
$bar = "rpm://" . __DIR__ . "/bidon.rpm#/etc/bar.conf";
+$toto = "rpm://" . __DIR__ . "/bidon.rpm#/etc/toto.conf";
echo "+ wrapper\n";
var_dump(in_array('rpm', stream_get_wrappers()));
echo "+ stat\n";
$s = stat($d); // S_ISDIR
-var_dump($s['size'], $s['mode'] , $s['mode'] & 0040000 ? "OK" : "KO");
-var_dump(file_exists($d), is_dir($d), is_file($d));
+var_dump($s['size'], $s['mode'] , ($s['mode'] & 0170000) == 0040000 ? "OK" : "KO");
+var_dump(file_exists($d), is_dir($d), is_file($d), is_link($n));
$s = stat($n); // S_ISREG
-var_dump($s['size'], $s['mode'] , $s['mode'] & 0100000 ? "OK" : "KO");
-var_dump(file_exists($n), is_dir($n), is_file($n));
+var_dump($s['size'], $s['mode'] , ($s['mode'] & 0170000) == 0100000 ? "OK" : "KO");
+var_dump(file_exists($n), is_dir($n), is_file($n), is_link($n));
+$s = stat($toto); // S_ISLNK
+var_dump($s['size'], $s['mode'] , ($s['mode'] & 0170000) == 0120000 ? "OK" : "KO");
+var_dump(file_exists($toto), is_dir($toto), is_file($toto), is_link($toto));
echo "+ file\n";
var_dump($f = fopen($n, "r"));
@@ -51,22 +55,31 @@ string(2) "OK"
bool(true)
bool(true)
bool(false)
+bool(false)
int(30)
int(33188)
string(2) "OK"
bool(true)
bool(false)
bool(true)
+bool(false)
+int(8)
+int(41471)
+string(2) "OK"
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+ file
resource(%d) of type (stream)
int(30)
int(33188)
-string(10) "Fri Oct 13"
+string(10) "Thu Oct 19"
bool(false)
-string(18) "12:24:27 CEST 2023"
+string(18) "12:01:02 CEST 2023"
bool(true)
+ stream
-string(29) "Fri Oct 13 12:24:27 CEST 2023"
+string(29) "Thu Oct 19 12:01:02 CEST 2023"
string(7) "content"
string(7) "content"