mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Add test to verify file_get_contents error with folder
Closes GH-6600.
This commit is contained in:
parent
4299e2de42
commit
df30f09be5
2 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,12 @@
|
|||
--TEST--
|
||||
Test file_get_contents() function : error when passing folder - on Windows
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) != "WIN") { print "skip - Windows only"; }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
file_get_contents(__DIR__);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: file_get_contents(%s): Failed to open stream: Permission denied in %s on line %d
|
12
ext/standard/tests/file/file_get_contents_error_folder.phpt
Normal file
12
ext/standard/tests/file/file_get_contents_error_folder.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--TEST--
|
||||
Test file_get_contents() function : error when passing folder
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) === "WIN") { print "skip - not valid for Windows"; }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
file_get_contents(__DIR__);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: file_get_contents(): Read of %d bytes failed with errno=21 Is a directory in %s on line %d
|
Loading…
Add table
Add a link
Reference in a new issue