summaryrefslogtreecommitdiff
path: root/ext/phar/tests/file_get_contents.phpt
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-04-13 19:36:33 +0000
committerGreg Beaver <cellog@php.net>2008-04-13 19:36:33 +0000
commit24d5595a8fc4ec5669bcd61a9659e7c08103d1ed (patch)
tree84a6f27928d4ff18b73589fbb5f8f2f8a709e9c1 /ext/phar/tests/file_get_contents.phpt
parent72daaf1d44dc1d3e0ce6f27f6fd0bdd948dd1305 (diff)
downloadphp-git-24d5595a8fc4ec5669bcd61a9659e7c08103d1ed.tar.gz
add test for file_get_contents interception, fix file_get_contents interception
Diffstat (limited to 'ext/phar/tests/file_get_contents.phpt')
-rw-r--r--ext/phar/tests/file_get_contents.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/phar/tests/file_get_contents.phpt b/ext/phar/tests/file_get_contents.phpt
new file mode 100644
index 0000000000..fcc9d64655
--- /dev/null
+++ b/ext/phar/tests/file_get_contents.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Phar: test file_get_contents() 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
+echo file_get_contents("dir/file1.txt");
+echo file_get_contents("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