]> granicus.if.org Git - php/commitdiff
new test for inclusion within phar that takes CWD into account
authorGreg Beaver <cellog@php.net>
Sat, 12 Jan 2008 22:25:40 +0000 (22:25 +0000)
committerGreg Beaver <cellog@php.net>
Sat, 12 Jan 2008 22:25:40 +0000 (22:25 +0000)
ext/phar/tests/frontcontroller13.phar [new file with mode: 0644]
ext/phar/tests/frontcontroller13.phar.inc [new file with mode: 0644]
ext/phar/tests/frontcontroller22.phpt [new file with mode: 0644]

diff --git a/ext/phar/tests/frontcontroller13.phar b/ext/phar/tests/frontcontroller13.phar
new file mode 100644 (file)
index 0000000..2434b1e
Binary files /dev/null and b/ext/phar/tests/frontcontroller13.phar differ
diff --git a/ext/phar/tests/frontcontroller13.phar.inc b/ext/phar/tests/frontcontroller13.phar.inc
new file mode 100644 (file)
index 0000000..0bfef46
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller13.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller13.phar');
+$a['index.php'] = '<?php
+var_dump("test");
+include "oof/test.php";';
+$a['oof/test.php'] = '<?php
+var_dump("oof/test.php");
+include "./hi.php";';
+$a['oof/hi.php'] = '<?php
+var_dump("hi");';
+$a->setStub('<?php
+Phar::webPhar();
+__HALT_COMPILER();');
\ No newline at end of file
diff --git a/ext/phar/tests/frontcontroller22.phpt b/ext/phar/tests/frontcontroller22.phpt
new file mode 100644 (file)
index 0000000..8053b61
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller include from cwd test 1
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller22.php/index.php
+REQUEST_URI=/frontcontroller22.php/index.php
+--FILE_EXTERNAL--
+frontcontroller13.phar
+--EXPECTHEADERS--
+Content-type: text/html
+--EXPECTF--
+string(4) "test"
+string(12) "oof/test.php"
+
+Warning: include(phar://%s/./hi.php): failed to open stream: phar error: "hi.php" is not a file in phar "%sfrontcontroller22.php" in phar://%s/oof/test.php on line %d
+
+Warning: include(): Failed opening './hi.php' for inclusion (include_path='%s') in phar://%soof/test.php on line %d
\ No newline at end of file