Skip to content

Commit 7fb16d5

Browse files
committed
Fix bug 61901 ext\phar\tests\phar_buildfromdirectory2.phpt fails
Another error message is produced by win specific code
1 parent c12fdbd commit 7fb16d5

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Phar::buildFromDirectory() - non-directory passed as first parameter
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded("phar")) die("skip");
6+
if (substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only test");
7+
?>
8+
--INI--
9+
phar.require_hash=0
10+
phar.readonly=0
11+
--FILE--
12+
<?php
13+
try {
14+
$phar = new Phar(dirname(__FILE__) . '/buildfromdirectory.phar');
15+
$phar->buildFromDirectory(1);
16+
} catch (Exception $e) {
17+
var_dump(get_class($e));
18+
echo $e->getMessage() . "\n";
19+
}
20+
?>
21+
===DONE===
22+
--CLEAN--
23+
<?php
24+
unlink(dirname(__FILE__) . '/buildfromdirectory.phar');
25+
__HALT_COMPILER();
26+
?>
27+
--EXPECTF--
28+
%s(24) "UnexpectedValueException"
29+
RecursiveDirectoryIterator::__construct(1,1): The system cannot find the file specified. (code: 2)
30+
===DONE===

ext/phar/tests/phar_buildfromdirectory2.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--TEST--
22
Phar::buildFromDirectory() - non-directory passed as first parameter
33
--SKIPIF--
4-
<?php if (!extension_loaded("phar")) die("skip"); ?>
4+
<?php
5+
if (!extension_loaded("phar")) die("skip");
6+
if (substr(PHP_OS, 0, 3) == "WIN") die("skip not for Windows");
7+
?>
58
--INI--
69
phar.require_hash=0
710
phar.readonly=0

0 commit comments

Comments
 (0)