]> granicus.if.org Git - php/commitdiff
new test for valid callback that fails for rewrite callback
authorGreg Beaver <cellog@php.net>
Wed, 23 Apr 2008 16:50:19 +0000 (16:50 +0000)
committerGreg Beaver <cellog@php.net>
Wed, 23 Apr 2008 16:50:19 +0000 (16:50 +0000)
ext/phar/tests/files/frontcontroller16.phar
ext/phar/tests/files/frontcontroller17.phar [new file with mode: 0644]
ext/phar/tests/files/frontcontroller17.phar.inc [new file with mode: 0644]
ext/phar/tests/frontcontroller32.phpt [new file with mode: 0644]

index 66fc1457082df566e95aee9f46ace7fdf7a4dff3..cce5db5bb5bc3f8fd50148f18cb217c4634e5bab 100644 (file)
Binary files a/ext/phar/tests/files/frontcontroller16.phar and b/ext/phar/tests/files/frontcontroller16.phar differ
diff --git a/ext/phar/tests/files/frontcontroller17.phar b/ext/phar/tests/files/frontcontroller17.phar
new file mode 100644 (file)
index 0000000..b83d41f
Binary files /dev/null and b/ext/phar/tests/files/frontcontroller17.phar differ
diff --git a/ext/phar/tests/files/frontcontroller17.phar.inc b/ext/phar/tests/files/frontcontroller17.phar.inc
new file mode 100644 (file)
index 0000000..85b8729
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller17.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller17.phar');
+$a['index.php'] = '<?php
+echo "hi";
+';
+$a->setStub('<?php
+try {
+Phar::webPhar("test.phar", "/index.php", null, array(), "sort");
+} catch (Exception $e) {
+die($e->getMessage() . "\n");
+}
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/frontcontroller32.phpt b/ext/phar/tests/frontcontroller32.phpt
new file mode 100644 (file)
index 0000000..c463bbb
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+Phar front controller with valid callback that is not good
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller32.php
+REQUEST_URI=/frontcontroller32.php
+--EXPECTHEADERS--
+Content-type: text/html
+--FILE_EXTERNAL--
+files/frontcontroller17.phar
+--EXPECTF--
+Warning: Parameter 1 to sort() expected to be a reference, value given in %sfrontcontroller32.php on line 3
+phar error: failed to call rewrite callback
\ No newline at end of file