iliaa                                    Tue, 05 Jan 2010 12:25:00 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=293144

Log:
Added test case for bug #50632

Bug: http://bugs.php.net/50632 (Closed) Return default value if var is undefined
      
Changed paths:
    A   php/php-src/branches/PHP_5_2/ext/filter/tests/bug50632.phpt
    A   php/php-src/branches/PHP_5_3/ext/filter/tests/bug50632.phpt
    A   php/php-src/trunk/ext/filter/tests/bug50632.phpt

Added: php/php-src/branches/PHP_5_2/ext/filter/tests/bug50632.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/filter/tests/bug50632.phpt                 
        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/filter/tests/bug50632.phpt 2010-01-05 
12:25:00 UTC (rev 293144)
@@ -0,0 +1,11 @@
+--TEST--
+bug 50632, filter_input() does not return default value if the variable does 
not exist
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
+--FILE--
+<?php
+$foo = filter_input(INPUT_GET, 'foo', FILTER_VALIDATE_INT, array('flags' => 
FILTER_REQUIRE_SCALAR, 'options' => array('default' => 23)));
+var_dump($foo);
+?>
+--EXPECT--
+int(23)

Added: php/php-src/branches/PHP_5_3/ext/filter/tests/bug50632.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/filter/tests/bug50632.phpt                 
        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/filter/tests/bug50632.phpt 2010-01-05 
12:25:00 UTC (rev 293144)
@@ -0,0 +1,11 @@
+--TEST--
+bug 50632, filter_input() does not return default value if the variable does 
not exist
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
+--FILE--
+<?php
+$foo = filter_input(INPUT_GET, 'foo', FILTER_VALIDATE_INT, array('flags' => 
FILTER_REQUIRE_SCALAR, 'options' => array('default' => 23)));
+var_dump($foo);
+?>
+--EXPECT--
+int(23)

Added: php/php-src/trunk/ext/filter/tests/bug50632.phpt
===================================================================
--- php/php-src/trunk/ext/filter/tests/bug50632.phpt                            
(rev 0)
+++ php/php-src/trunk/ext/filter/tests/bug50632.phpt    2010-01-05 12:25:00 UTC 
(rev 293144)
@@ -0,0 +1,11 @@
+--TEST--
+bug 50632, filter_input() does not return default value if the variable does 
not exist
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
+--FILE--
+<?php
+$foo = filter_input(INPUT_GET, 'foo', FILTER_VALIDATE_INT, array('flags' => 
FILTER_REQUIRE_SCALAR, 'options' => array('default' => 23)));
+var_dump($foo);
+?>
+--EXPECT--
+int(23)

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

Reply via email to