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:
committed by
Christoph M. Becker
parent
4299e2de42
commit
df30f09be5
@@ -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
|
||||
Reference in New Issue
Block a user