jani                                     Tue, 04 Aug 2009 12:16:40 +0000

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

Log:
- Add test (yes, it fails still :)

Changed paths:
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug48660.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug48660.phpt
    A   php/php-src/trunk/ext/standard/tests/general_functions/bug48660.phpt

Added: 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug48660.phpt
===================================================================
--- 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug48660.phpt 
                            (rev 0)
+++ 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug48660.phpt 
    2009-08-04 12:16:40 UTC (rev 286804)
@@ -0,0 +1,58 @@
+--TEST--
+Bug #48660 (parse_ini_*(): dollar sign as last character of value fails)
+--FILE--
+<?php
+
+$ini_location = dirname(__FILE__) . '/bug48660.tmp';
+
+// Build ini data
+$ini_data = '
+[cases]
+
+Case.a = avalue
+Case.b = "$dollar_sign"
+Case.c = "dollar_sign$"
+Case.d = "$dollar_sign$"
+Case.e = 10
+';
+
+// Save ini data to file
+file_put_contents($ini_location, $ini_data);
+
+var_dump(parse_ini_file($ini_location, true));
+var_dump(parse_ini_file($ini_location, true));
+
+?>
+--CLEAN--
+<?php @unlink(dirname(__FILE__) . '/bug48660.tmp'); ?>
+--EXPECTF--
+array(1) {
+  ["cases"]=>
+  array(5) {
+    ["Case.a"]=>
+    string(6) "avalue"
+    ["Case.b"]=>
+    string(12) "$dollar_sign"
+    ["Case.c"]=>
+    string(12) "dollar_sign$"
+    ["Case.d"]=>
+    string(13) "$dollar_sign$"
+    ["Case.e"]=>
+    string(2) "10"
+  }
+}
+array(1) {
+  ["cases"]=>
+  array(5) {
+    ["Case.a"]=>
+    string(6) "avalue"
+    ["Case.b"]=>
+    string(12) "$dollar_sign"
+    ["Case.c"]=>
+    string(12) "dollar_sign$"
+    ["Case.d"]=>
+    string(13) "$dollar_sign$"
+    ["Case.e"]=>
+    string(2) "10"
+  }
+}

Added: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug48660.phpt
===================================================================
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug48660.phpt 
                            (rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug48660.phpt 
    2009-08-04 12:16:40 UTC (rev 286804)
@@ -0,0 +1,58 @@
+--TEST--
+Bug #48660 (parse_ini_*(): dollar sign as last character of value fails)
+--FILE--
+<?php
+
+$ini_location = dirname(__FILE__) . '/bug48660.tmp';
+
+// Build ini data
+$ini_data = '
+[cases]
+
+Case.a = avalue
+Case.b = "$dollar_sign"
+Case.c = "dollar_sign$"
+Case.d = "$dollar_sign$"
+Case.e = 10
+';
+
+// Save ini data to file
+file_put_contents($ini_location, $ini_data);
+
+var_dump(parse_ini_file($ini_location, true, INI_SCANNER_RAW));
+var_dump(parse_ini_file($ini_location, true, INI_SCANNER_NORMAL));
+
+?>
+--CLEAN--
+<?php @unlink(dirname(__FILE__) . '/bug48660.tmp'); ?>
+--EXPECTF--
+array(1) {
+  ["cases"]=>
+  array(5) {
+    ["Case.a"]=>
+    string(6) "avalue"
+    ["Case.b"]=>
+    string(12) "$dollar_sign"
+    ["Case.c"]=>
+    string(12) "dollar_sign$"
+    ["Case.d"]=>
+    string(13) "$dollar_sign$"
+    ["Case.e"]=>
+    string(2) "10"
+  }
+}
+array(1) {
+  ["cases"]=>
+  array(5) {
+    ["Case.a"]=>
+    string(6) "avalue"
+    ["Case.b"]=>
+    string(12) "$dollar_sign"
+    ["Case.c"]=>
+    string(12) "dollar_sign$"
+    ["Case.d"]=>
+    string(13) "$dollar_sign$"
+    ["Case.e"]=>
+    string(2) "10"
+  }
+}

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug48660.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/general_functions/bug48660.phpt        
                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug48660.phpt        
2009-08-04 12:16:40 UTC (rev 286804)
@@ -0,0 +1,58 @@
+--TEST--
+Bug #48660 (parse_ini_*(): dollar sign as last character of value fails)
+--FILE--
+<?php
+
+$ini_location = dirname(__FILE__) . '/bug48660.tmp';
+
+// Build ini data
+$ini_data = '
+[cases]
+
+Case.a = avalue
+Case.b = "$dollar_sign"
+Case.c = "dollar_sign$"
+Case.d = "$dollar_sign$"
+Case.e = 10
+';
+
+// Save ini data to file
+file_put_contents($ini_location, $ini_data);
+
+var_dump(parse_ini_file($ini_location, true, INI_SCANNER_RAW));
+var_dump(parse_ini_file($ini_location, true, INI_SCANNER_NORMAL));
+
+?>
+--CLEAN--
+<?php @unlink(dirname(__FILE__) . '/bug48660.tmp'); ?>
+--EXPECTF--
+array(1) {
+  ["cases"]=>
+  array(5) {
+    ["Case.a"]=>
+    string(6) "avalue"
+    ["Case.b"]=>
+    string(12) "$dollar_sign"
+    ["Case.c"]=>
+    string(12) "dollar_sign$"
+    ["Case.d"]=>
+    string(13) "$dollar_sign$"
+    ["Case.e"]=>
+    string(2) "10"
+  }
+}
+array(1) {
+  ["cases"]=>
+  array(5) {
+    ["Case.a"]=>
+    string(6) "avalue"
+    ["Case.b"]=>
+    string(12) "$dollar_sign"
+    ["Case.c"]=>
+    string(12) "dollar_sign$"
+    ["Case.d"]=>
+    string(13) "$dollar_sign$"
+    ["Case.e"]=>
+    string(2) "10"
+  }
+}

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

Reply via email to