1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Files
archived-php-src/ext/standard/tests/dir/readdir_error-win32-mb.phpt
T
Anatol Belski 596f488e06 Add skipifs to some mb path tests
These were invented primarily to test the multibyte path handling
patch on Windows. How it turns out by PR #2105, some test issues
on some filesystems are possible. Particularly HFS is configurable
to use different ways to save filenames, see
https://developer.apple.com/library/mac/qa/qa1173/_index.html
This makes it impossible to test the filenames byte wise, while
the results are still correct. There are still several other tests
using UTF-8 file names spread over other extensions. So far no
false positives are to see, they don't need to be touched.
2016-09-02 19:46:32 +02:00

50 lines
1.2 KiB
PHP

--TEST--
Test readdir() function : error conditions - Incorrect number of args
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
die("skip Valid only on Windows");
}
?>
--FILE--
<?php
/* Prototype : string readdir([resource $dir_handle])
* Description: Read directory entry from dir_handle
* Source code: ext/standard/dir.c
*/
/*
* Pass incorrect number of arguments to readdir() to test behaviour
*/
echo "*** Testing readdir() : error conditions ***\n";
//Test readdir with one more than the expected number of arguments
echo "\n-- Testing readdir() function with more than expected no. of arguments --\n";
$path = dirname(__FILE__) . "/私はガラスを食べられますreaddir_error";
mkdir($path);
$dir_handle = opendir($path);
$extra_arg = 10;
var_dump( readdir($dir_handle, $extra_arg) );
// close the handle so can remove dir in CLEAN section
closedir($dir_handle);
?>
===DONE===
--CLEAN--
<?php
$path = dirname(__FILE__) . "/私はガラスを食べられますreaddir_error";
rmdir($path);
?>
--EXPECTF--
*** Testing readdir() : error conditions ***
-- Testing readdir() function with more than expected no. of arguments --
Warning: readdir() expects at most 1 parameter, 2 given in %s on line %d
NULL
===DONE===