summaryrefslogtreecommitdiffstats
path: root/tests/014-stream.phpt
diff options
context:
space:
mode:
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"