Add test to verify file_get_contents error with folder

Closes GH-6600.
This commit is contained in:
Anna Filina 2021-01-13 13:41:37 +01:00 committed by Christoph M. Becker
parent 4299e2de42
commit df30f09be5
2 changed files with 24 additions and 0 deletions

View file

@ -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

View 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