Skip to content

Commit 43315f3

Browse files
committed
added PHPT to check for bug #69628
1 parent abb616a commit 43315f3

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

ext/standard/tests/file/bug69628.phpt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
--TEST--
2+
Bug #69628: GLOB_BRACE with multiple brackets within the braces fails
3+
--FILE--
4+
<?php
5+
6+
$file_path = dirname(__FILE__);
7+
8+
// temp dirname used here
9+
$dirname = "$file_path/bug69628";
10+
11+
// temp dir created
12+
mkdir($dirname);
13+
14+
// temp files created
15+
file_put_contents("$dirname/image.jPg", '');
16+
file_put_contents("$dirname/image.gIf", '');
17+
file_put_contents("$dirname/image.png", '');
18+
19+
sort_var_dump(glob("$dirname/*.{[jJ][pP][gG],[gG][iI][fF]}", GLOB_BRACE));
20+
21+
function sort_var_dump($results) {
22+
sort($results);
23+
var_dump($results);
24+
}
25+
26+
?>
27+
--CLEAN--
28+
<?php
29+
30+
$file_path = dirname(__FILE__);
31+
unlink("$file_path/bug69628/image.jPg");
32+
unlink("$file_path/bug69628/image.gIf");
33+
unlink("$file_path/bug69628/image.png");
34+
rmdir("$file_path/bug69628/");
35+
36+
?>
37+
--EXPECTF--
38+
array(2) {
39+
[0]=>
40+
string(%d) "%s/bug69628/image.gIf"
41+
[1]=>
42+
string(%d) "%s/bug69628/image.jPg"
43+
}

0 commit comments

Comments
 (0)