1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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