source: branches/version-2_5-dev/data/module/Compat/tests/function/scandir.phpt @ 20116

Revision 20116, 671 bytes checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
Line 
1--TEST--
2Function -- scandir
3--SKIPIF--
4<?php if (function_exists('scandir')) { echo 'skip'; } ?>
5--FILE--
6<?php
7require_once 'PHP/Compat.php';
8PHP_Compat::loadFunction('scandir');
9
10// Create a folder and fill it with files
11mkdir('tmp');
12touch('tmp/test1');
13touch('tmp/test2');
14
15// Scan it
16$dir    = 'tmp';
17// Not sorted
18$files = scandir($dir);
19// Sorted
20$files2 = scandir($dir, 1);
21
22// List the results
23print_r($files);
24print_r($files2);
25
26// Remove the files
27unlink('tmp/test1');
28unlink('tmp/test2');
29rmdir('tmp');
30?>
31--EXPECT--
32Array
33(
34    [0] => .
35    [1] => ..
36    [2] => test1
37    [3] => test2
38)
39Array
40(
41    [0] => test2
42    [1] => test1
43    [2] => ..
44    [3] => .
45)
Note: See TracBrowser for help on using the repository browser.