Skip to content

Commit ea1be26

Browse files
committed
Update cache_list tests
TODO: It seems like one needs to copy the files from ext/phar/tests/files/ to ext/phar/tests/cache_list/files/ and that they were out of sync
1 parent a761c1c commit ea1be26

36 files changed

+85
-65
lines changed
97 Bytes
Binary file not shown.

ext/phar/tests/cache_list/files/frontcontroller10.phar.inc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ var_dump($_SERVER["PHAR_SCRIPT_FILENAME"]);
1212
var_dump($_SERVER["PHAR_REQUEST_URI"]);
1313
';
1414
$a->setStub('<?php
15-
Phar::mungServer(array("PHP_SELF", "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI", "OOPSIE"));
16-
Phar::webPhar();
15+
try {
16+
Phar::mungServer(array("PHP_SELF", "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI", "OOPSIE"));
17+
Phar::webPhar();
18+
} catch (Throwable $e) {
19+
die($e::class . ": " . $e->getMessage() . "\n");
20+
}
1721
echo "oops did not run\n";
1822
var_dump($_ENV, $_SERVER);
1923
__HALT_COMPILER();');
97 Bytes
Binary file not shown.

ext/phar/tests/cache_list/files/frontcontroller11.phar.inc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ var_dump($_SERVER["PHAR_SCRIPT_FILENAME"]);
1212
var_dump($_SERVER["PHAR_REQUEST_URI"]);
1313
';
1414
$a->setStub('<?php
15-
Phar::mungServer(array(array(), "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI"));
16-
Phar::webPhar();
15+
try {
16+
Phar::mungServer(array(array(), "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI"));
17+
Phar::webPhar();
18+
} catch (Throwable $e) {
19+
die($e::class . ": " . $e->getMessage() . "\n");
20+
}
1721
echo "oops did not run\n";
1822
var_dump($_ENV, $_SERVER);
1923
__HALT_COMPILER();');
97 Bytes
Binary file not shown.

ext/phar/tests/cache_list/files/frontcontroller12.phar.inc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ var_dump($_SERVER["PHAR_SCRIPT_FILENAME"]);
1212
var_dump($_SERVER["PHAR_REQUEST_URI"]);
1313
';
1414
$a->setStub('<?php
15-
Phar::mungServer(array("PHP_SELF", "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI"));
16-
Phar::webPhar();
15+
try {
16+
Phar::mungServer(array("PHP_SELF", "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI"));
17+
Phar::webPhar();
18+
} catch (Throwable $e) {
19+
die($e::class . ": " . $e->getMessage() . "\n");
20+
}
1721
echo "oops did not run\n";
1822
var_dump($_ENV, $_SERVER);
1923
__HALT_COMPILER();');
110 Bytes
Binary file not shown.

ext/phar/tests/cache_list/files/frontcontroller14.phar.inc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ function s($a)
1010
{
1111
return "/html/index.php";
1212
}
13-
Phar::interceptFileFuncs();
14-
Phar::mungServer(array("PHP_SELF", "REQUEST_URI"));
15-
Phar::webPhar("whatever", "/html/index.php", null, array(), "s");
13+
try {
14+
Phar::interceptFileFuncs();
15+
Phar::mungServer(array("PHP_SELF", "REQUEST_URI"));
16+
Phar::webPhar("whatever", "/html/index.php", null, array(), "s");
17+
} catch (Throwable $e) {
18+
die($e::class . ": " . $e->getMessage() . "\n");
19+
}
1620
echo "oops did not run\n";
1721
var_dump($_ENV, $_SERVER);
1822
__HALT_COMPILER();');
33 Bytes
Binary file not shown.

ext/phar/tests/cache_list/files/frontcontroller16.phar.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ echo "hi";
66
';
77
$a->setStub('<?php
88
try {
9-
Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
10-
} catch (TypeError|Exception $e) {
11-
die($e->getMessage() . "\n");
9+
Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
10+
} catch (Throwable $e) {
11+
die($e::class . ": " . $e->getMessage() . "\n");
1212
}
1313
echo "oops did not run\n";
1414
var_dump($_ENV, $_SERVER);

0 commit comments

Comments
 (0)