diff options
author | Remi Collet <remi@remirepo.net> | 2023-10-12 12:48:34 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-10-12 12:48:34 +0200 |
commit | 9104d986ab93577575eab6cc7c750b1adb84b46a (patch) | |
tree | 9fba62d46982147576c44989ee802d60431f34e2 /tests | |
parent | 858524052cd950ffe79d40464df8a83cedf19776 (diff) |
implement rpm stream wrapper
Diffstat (limited to 'tests')
-rw-r--r-- | tests/014-stream.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/014-stream.phpt b/tests/014-stream.phpt new file mode 100644 index 0000000..5a4fefa --- /dev/null +++ b/tests/014-stream.phpt @@ -0,0 +1,34 @@ +--TEST-- +Check for stream +--SKIPIF-- +<?php if (!extension_loaded("rpminfo")) print "skip"; ?> +--FILE-- +<?php +$n = "rpm://" . __DIR__ . "/bidon.rpm#/usr/share/doc/bidon/README"; + +var_dump(in_array('rpm', stream_get_wrappers())); + +var_dump($f = fopen($n, "r")); +var_dump(trim(fread($f, 10))); +var_dump(feof($f)); +var_dump(trim(fread($f, 100))); +var_dump(feof($f)); +fclose($f); + +var_dump(trim(file_get_contents($n))); + +var_dump(file_get_contents(str_replace('README', 'TODO', $n))); +?> +Done +--EXPECTF-- +bool(true) +resource(%d) of type (stream) +string(10) "Mon Feb 12" +bool(false) +string(17) "13:27:47 CET 2018" +bool(true) +string(28) "Mon Feb 12 13:27:47 CET 2018" + +Warning: file_get_contents(%s/bidon.rpm#/usr/share/doc/bidon/TODO): Failed to open stream: operation failed in %s on line %d +bool(false) +Done |