kraghuba                Fri Aug 10 03:33:00 2007 UTC

  Modified files:              
    /php-src/ext/standard/tests/file    tempnam_error.phpt 
  Log:
  more new testcases for tempnam() function
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/tempnam_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/tempnam_error.phpt
diff -u /dev/null php-src/ext/standard/tests/file/tempnam_error.phpt:1.2
--- /dev/null   Fri Aug 10 03:33:00 2007
+++ php-src/ext/standard/tests/file/tempnam_error.phpt  Fri Aug 10 03:33:00 2007
@@ -0,0 +1,72 @@
+--TEST--
+Test tempnam() function: error conditions
+--FILE--
+<?php
+/* Prototype:  string tempnam ( string $dir, string $prefix );
+   Description: Create file with unique file name.
+*/
+
+echo "*** Testing tempnam() error conditions ***\n";
+$file_path = dirname(__FILE__);
+
+/* More number of arguments than expected */
+var_dump( tempnam("$file_path", "tempnam_error.tmp", "") ); //Two Valid & One 
Invalid
+var_dump( tempnam("$file_path", "tempnam_error.tmp", TRUE) );
+
+/* Less number of arguments than expected */
+var_dump( tempnam("tempnam_error") );  //One Valid arg
+var_dump( tempnam("$file_path") );  //One Valid arg
+var_dump( tempnam("") );  //Empty string
+var_dump( tempnam(NULL) );  //NULL as arg
+var_dump( tempnam() );  //Zero args
+
+echo "*** Done ***\n";
+?>
+--EXPECTF--
+*** Testing tempnam() error conditions ***
+
+Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+*** Done ***
+--UEXPECTF--
+*** Testing tempnam() error conditions ***
+
+Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: tempnam() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+*** Done ***

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to