Skip to content

Commit df30f09

Browse files
afilinacmb69
authored andcommitted
Add test to verify file_get_contents error with folder
Closes GH-6600.
1 parent 4299e2d commit df30f09

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Test file_get_contents() function : error when passing folder - on Windows
3+
--SKIPIF--
4+
<?php
5+
if (substr(PHP_OS, 0, 3) != "WIN") { print "skip - Windows only"; }
6+
?>
7+
--FILE--
8+
<?php
9+
file_get_contents(__DIR__);
10+
?>
11+
--EXPECTF--
12+
Warning: file_get_contents(%s): Failed to open stream: Permission denied in %s on line %d
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Test file_get_contents() function : error when passing folder
3+
--SKIPIF--
4+
<?php
5+
if (substr(PHP_OS, 0, 3) === "WIN") { print "skip - not valid for Windows"; }
6+
?>
7+
--FILE--
8+
<?php
9+
file_get_contents(__DIR__);
10+
?>
11+
--EXPECTF--
12+
Notice: file_get_contents(): Read of %d bytes failed with errno=21 Is a directory in %s on line %d

0 commit comments

Comments
 (0)