diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
|---|---|---|
| committer | <> | 2013-04-03 16:25:08 +0000 |
| commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
| tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/phar/tests/readfile.phpt | |
| download | php2-master.tar.gz | |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/phar/tests/readfile.phpt')
| -rw-r--r-- | ext/phar/tests/readfile.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/phar/tests/readfile.phpt b/ext/phar/tests/readfile.phpt new file mode 100644 index 0000000..60fdad1 --- /dev/null +++ b/ext/phar/tests/readfile.phpt @@ -0,0 +1,30 @@ +--TEST-- +Phar: test readfile() interception +--SKIPIF-- +<?php if (!extension_loaded("phar")) die("skip");?> +--INI-- +phar.require_hash=1 +phar.readonly=0 +--FILE-- +<?php +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; +$a = new Phar($fname); +$a['index.php'] = '<?php +readfile("dir/file1.txt"); +readfile("file1.txt", true); +?>'; +$a['dir/file1.txt'] = 'hi'; +$a['dir/file2.txt'] = 'hi2'; +$a['dir/file3.txt'] = 'hi3'; +$a->setStub('<?php +Phar::interceptFileFuncs(); +set_include_path("phar://" . __FILE__ . "/dir" . PATH_SEPARATOR . "phar://" . __FILE__); +include "index.php"; +__HALT_COMPILER();'); +include $fname; +?> +===DONE=== +--CLEAN-- +<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> +--EXPECT-- +hihi===DONE===
\ No newline at end of file |
