~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/standard/tests/dir/rewinddir_error.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Test rewinddir() function : error conditions - incorrect number of args
 
3
--FILE--
 
4
<?php
 
5
/* Prototype  : void rewinddir([resource $dir_handle])
 
6
 * Description: Rewind dir_handle back to the start 
 
7
 * Source code: ext/standard/dir.c
 
8
 * Alias to functions: rewind
 
9
 */
 
10
 
 
11
/*
 
12
 * Pass incorrect number of arguments to rewinddir() to test behaviour
 
13
 */
 
14
 
 
15
echo "*** Testing rewinddir() : error conditions ***\n";
 
16
 
 
17
 
 
18
//Test rewinddir with one more than the expected number of arguments
 
19
echo "\n-- Testing rewinddir() function with more than expected no. of arguments --\n";
 
20
 
 
21
$dir_path = dirname(__FILE__) . "/rewinddir_error";
 
22
mkdir($dir_path);
 
23
$dir_handle = opendir($dir_path);
 
24
$extra_arg = 10;
 
25
 
 
26
var_dump( rewinddir($dir_handle, $extra_arg) );
 
27
closedir($dir_handle);
 
28
?>
 
29
===DONE===
 
30
--CLEAN--
 
31
<?php
 
32
$dir_path = dirname(__FILE__) . "/rewinddir_error";
 
33
rmdir($dir_path);
 
34
?>
 
35
--EXPECTF--
 
36
*** Testing rewinddir() : error conditions ***
 
37
 
 
38
-- Testing rewinddir() function with more than expected no. of arguments --
 
39
 
 
40
Warning: rewinddir() expects at most 1 parameter, 2 given in %s on line %d
 
41
NULL
 
42
===DONE===