summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/general_functions')
-rw-r--r--ext/standard/tests/general_functions/001.phpt69
-rw-r--r--ext/standard/tests/general_functions/002.phpt13
-rw-r--r--ext/standard/tests/general_functions/003.phpt60
-rw-r--r--ext/standard/tests/general_functions/004.data4
-rw-r--r--ext/standard/tests/general_functions/004.phpt18
-rw-r--r--ext/standard/tests/general_functions/005.phpt26
-rw-r--r--ext/standard/tests/general_functions/006.phpt13
-rw-r--r--ext/standard/tests/general_functions/007.phpt26
-rw-r--r--ext/standard/tests/general_functions/008.phpt40
-rw-r--r--ext/standard/tests/general_functions/009.phpt26
-rwxr-xr-xext/standard/tests/general_functions/bug25038.phpt32
-rw-r--r--ext/standard/tests/general_functions/getopt.phpt30
-rw-r--r--ext/standard/tests/general_functions/highlight_heredoc.phpt19
-rw-r--r--ext/standard/tests/general_functions/proc_open.phpt30
-rw-r--r--ext/standard/tests/general_functions/sunfuncts.phpt44
15 files changed, 0 insertions, 450 deletions
diff --git a/ext/standard/tests/general_functions/001.phpt b/ext/standard/tests/general_functions/001.phpt
deleted file mode 100644
index e84622902c..0000000000
--- a/ext/standard/tests/general_functions/001.phpt
+++ /dev/null
@@ -1,69 +0,0 @@
---TEST--
-sprintf() function
---POST--
---GET--
---FILE--
-<?php
-
-$agent = sprintf("%.5s", "James Bond, 007");
-
-echo("sprintf string truncate test: ");
-if ($agent == "James") {
- echo("passed\n");
-} else {
- echo("failed!\n");
-}
-
-echo("sprintf padding and align test: ");
-$test = sprintf("abc%04d %-20s%c", 20, "fisketur", 33);
-if ($test == "abc0020 fisketur !") {
- echo("passed\n");
-} else {
- echo("failed!\n");
-}
-
-echo("sprintf octal and hex test: ");
-$test = sprintf("%4o %4x %4X %0"."8x", 128, 1024, 49151, 3457925);
-if ($test == " 200 400 BFFF 0034c385") {
- echo("passed\n");
-} else {
- echo("failed!\n");
-}
-
-echo("sprintf octal binary test: ");
-$test = sprintf("%b", 3457925);
-if ($test == "1101001100001110000101") {
- echo("passed\n");
-} else {
- echo("failed!\n");
-}
-
-echo("sprintf float test: ");
-$test = sprintf("%0"."06.2f", 10000/3.0);
-if ($test == "003333.33") {
- echo("passed\n");
-} else {
- echo("failed!\n");
-}
-
-echo sprintf("%.2f\n", "99.00");
-echo sprintf("%.2f\n", 99.00);
-
-echo sprintf("%e\n", 1.234E-18);
-echo sprintf("%e\n", 1.234E+18);
-echo sprintf("%e\n", 9843243.12);
-echo sprintf("%e\n", -9843243.12);
-
-?>
---EXPECT--
-sprintf string truncate test: passed
-sprintf padding and align test: passed
-sprintf octal and hex test: passed
-sprintf octal binary test: passed
-sprintf float test: passed
-99.00
-99.00
-1.23400e-18
-1.23400e+18
-9.84324e+6
--9.84324e+6
diff --git a/ext/standard/tests/general_functions/002.phpt b/ext/standard/tests/general_functions/002.phpt
deleted file mode 100644
index 8ab1a72f07..0000000000
--- a/ext/standard/tests/general_functions/002.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-quoted_printable_decode() function test
---POST--
---GET--
---FILE--
-<?php echo quoted_printable_decode("=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A=
-=20=D4=cf=D2=C7=CF=D7=D9=C5=
-=20=
-=D0=
-=D2=CF=C5=CB=D4=D9"); ?>
---EXPECT--
-úwow-factorÁÐÕÝÅÎÎÙÅ
- ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ
diff --git a/ext/standard/tests/general_functions/003.phpt b/ext/standard/tests/general_functions/003.phpt
deleted file mode 100644
index 141b4d7052..0000000000
--- a/ext/standard/tests/general_functions/003.phpt
+++ /dev/null
@@ -1,60 +0,0 @@
---TEST--
-levenshtein() function test
---POST--
---GET--
---FILE--
-<?php
-
-function test_me($title,$expect,$text1,$text2,$cost1=0,$cost2=0,$cost3=0) {
-
- if($cost1==0)
- $result=levenshtein($text1,$text2);
- else
- $result=levenshtein($text1,$text2,$cost1,$cost2,$cost3);
-
- if($result==$expect) return 0;
-
- echo "$title: result is $result instead of $expect ";
- echo "for '$text1'/'$text2' ";
- if($cost1) echo "($cost1:$cost2:$cost3)";
- echo "\n";
-
- return 1;
-}
-
-$n=0;
-
-$n += test_me("equal" , 0, "12345", "12345");
-$n += test_me("1st empty" , 3, "", "xzy");
-$n += test_me("2nd empty" , 3, "xzy", "");
-$n += test_me("both empty" , 0, "", "");
-$n += test_me("1 char" , 1, "1", "2");
-$n += test_me("2 char swap", 2, "12", "21");
-
-$n += test_me("inexpensive delete", 2, "2121", "11", 2, 1, 1);
-$n += test_me("expensive delete" , 10, "2121", "11", 2, 1, 5);
-$n += test_me("inexpensive insert", 2, "11", "2121", 1, 1, 1);
-$n += test_me("expensive insert" , 10, "11", "2121", 5, 1, 1);
-
-$n += test_me("expensive replace" , 3, "111", "121", 2, 3, 2);
-$n += test_me("very expensive replace", 4, "111", "121", 2, 9, 2);
-
-$n += test_me("bug #7368", 2, "13458", "12345");
-$n += test_me("bug #7368", 2, "1345", "1234");
-
-$n += test_me("bug #6562", 1, "debugg", "debug");
-$n += test_me("bug #6562", 1, "ddebug", "debug");
-$n += test_me("bug #6562", 2, "debbbug", "debug");
-$n += test_me("bug #6562", 1, "debugging", "debuging");
-
-$n += test_me("bug #16473", 2, "a", "bc");
-$n += test_me("bug #16473", 2, "xa", "xbc");
-$n += test_me("bug #16473", 2, "xax", "xbcx");
-$n += test_me("bug #16473", 2, "ax", "bcx");
-
-
-echo ($n==0)?"all passed\n":"$n failed\n";
-
-?>
---EXPECT--
-all passed
diff --git a/ext/standard/tests/general_functions/004.data b/ext/standard/tests/general_functions/004.data
deleted file mode 100644
index 5dd0832842..0000000000
--- a/ext/standard/tests/general_functions/004.data
+++ /dev/null
@@ -1,4 +0,0 @@
-name value comment
-true 1 boolean true
-false 0 boolean false
-empty nothing
diff --git a/ext/standard/tests/general_functions/004.phpt b/ext/standard/tests/general_functions/004.phpt
deleted file mode 100644
index 3bd1fb1eac..0000000000
--- a/ext/standard/tests/general_functions/004.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-fgetcsv() with tab delimited fields (BUG #8258)
---POST--
---GET--
---FILE--
-<?php
-chdir(dirname(__FILE__));
-$fp=fopen("004.data","r");
-while($a=fgetcsv($fp,100,"\t")) {
- echo join(",",$a)."\n";
-}
-fclose($fp);
-?>
---EXPECT--
-name,value,comment
-true,1,boolean true
-false,0,boolean false
-empty,,nothing
diff --git a/ext/standard/tests/general_functions/005.phpt b/ext/standard/tests/general_functions/005.phpt
deleted file mode 100644
index 329d46e764..0000000000
--- a/ext/standard/tests/general_functions/005.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-is_scalar() function test
---POST--
---GET--
---FILE--
-<?php
-class foo {}
-var_dump (is_scalar (TRUE));
-var_dump (is_scalar (1));
-var_dump (is_scalar (1.0));
-var_dump (is_scalar ("Hi!"));
-var_dump (is_scalar (NULL));
-var_dump (is_scalar (array ()));
-var_dump (is_scalar (new foo()));
-var_dump (is_scalar (opendir('.')));
-?>
---EXPECT--
-bool(true)
-bool(true)
-bool(true)
-bool(true)
-bool(false)
-bool(false)
-bool(false)
-bool(false)
-
diff --git a/ext/standard/tests/general_functions/006.phpt b/ext/standard/tests/general_functions/006.phpt
deleted file mode 100644
index 9db1ca3280..0000000000
--- a/ext/standard/tests/general_functions/006.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-quoted_printable_decode() function test with CR/LF
---POST--
---GET--
---FILE--
-<?php echo quoted_printable_decode("=FAwow-factor=C1=D0=D5=DD=C5=CE=CE=D9=C5=0A=
-=20=D4=CF=D2=C7=CF=D7=D9=C5=
-=20=
-=D0=
-=D2=CF=C5=CB=D4=D9"); ?>
---EXPECT--
-úwow-factorÁÐÕÝÅÎÎÙÅ
- ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ
diff --git a/ext/standard/tests/general_functions/007.phpt b/ext/standard/tests/general_functions/007.phpt
deleted file mode 100644
index 422ff3d94f..0000000000
--- a/ext/standard/tests/general_functions/007.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-MD5 / Base64
---POST--
---GET--
---FILE--
-<?php
-function test($str) {
- $res = md5(base64_decode(base64_encode($str)))."\n";
- return $res;
-}
-echo test("");
-echo test("a");
-echo test("abc");
-echo test("message digest");
-echo test("abcdefghijklmnopqrstuvwxyz");
-echo test("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
-echo test("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
-?>
---EXPECT--
-d41d8cd98f00b204e9800998ecf8427e
-0cc175b9c0f1b6a831c399e269772661
-900150983cd24fb0d6963f7d28e17f72
-f96b697d7cb7938d525a2f31aaf161d0
-c3fcd3d76192e4007dfb496cca67e13b
-d174ab98d277d9f5a5611c2c9f419d9f
-57edf4a22be3c955ac49da2e2107b67a
diff --git a/ext/standard/tests/general_functions/008.phpt b/ext/standard/tests/general_functions/008.phpt
deleted file mode 100644
index bb633c334d..0000000000
--- a/ext/standard/tests/general_functions/008.phpt
+++ /dev/null
@@ -1,40 +0,0 @@
---TEST--
-var_dump float test
---INI--
-precision=12
---FILE--
-<?php
-// this checks f,g,G conversion for snprintf/spprintf
-var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.0000123,123456789012.0,1234567890123.0,12345678901234567890.0));
-?>
---EXPECT--
-array(14) {
- [0]=>
- string(2) "12"
- [1]=>
- float(0.012)
- [2]=>
- float(-0.012)
- [3]=>
- float(0.12)
- [4]=>
- float(-0.12)
- [5]=>
- float(1.2)
- [6]=>
- float(-1.2)
- [7]=>
- float(12)
- [8]=>
- float(-12)
- [9]=>
- float(0.000123)
- [10]=>
- float(1.23E-5)
- [11]=>
- float(123456789012)
- [12]=>
- float(1234567890120)
- [13]=>
- float(1.23456789012E+19)
-} \ No newline at end of file
diff --git a/ext/standard/tests/general_functions/009.phpt b/ext/standard/tests/general_functions/009.phpt
deleted file mode 100644
index 68c1f4d87b..0000000000
--- a/ext/standard/tests/general_functions/009.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-SHA1
---POST--
---GET--
---FILE--
-<?php
-function test($str) {
- $res = sha1($str)."\n";
- return $res;
-}
-echo test("");
-echo test("a");
-echo test("abc");
-echo test("message digest");
-echo test("abcdefghijklmnopqrstuvwxyz");
-echo test("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
-echo test("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
-?>
---EXPECT--
-da39a3ee5e6b4b0d3255bfef95601890afd80709
-86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
-a9993e364706816aba3e25717850c26c9cd0d89d
-c12252ceda8be8994d5fa0290a47231c1d16aae3
-32d10c7b8cf96570ca04ce37f2a19d84240d3a89
-761c457bf73b14d27e9e9265c46f4b4dda11f940
-50abf5706a150990a08b2c5ea40fa0e585554732
diff --git a/ext/standard/tests/general_functions/bug25038.phpt b/ext/standard/tests/general_functions/bug25038.phpt
deleted file mode 100755
index 52fe032056..0000000000
--- a/ext/standard/tests/general_functions/bug25038.phpt
+++ /dev/null
@@ -1,32 +0,0 @@
---TEST--
-Bug #25038 (call_user_func issues warning if function throws exception)
---FILE--
-<?php
-
-function bar($x='no argument')
-{
- throw new Exception("This is an exception from bar({$x}).");
-}
-try
-{
- bar('first try');
-}
-catch (Exception $e)
-{
- print $e->getMessage()."\n";
-}
-try
-{
- call_user_func('bar','second try');
-}
-catch (Exception $e)
-{
- print $e->getMessage()."\n";
-}
-
-?>
-===DONE===
---EXPECT--
-This is an exception from bar(first try).
-This is an exception from bar(second try).
-===DONE===
diff --git a/ext/standard/tests/general_functions/getopt.phpt b/ext/standard/tests/general_functions/getopt.phpt
deleted file mode 100644
index e861268459..0000000000
--- a/ext/standard/tests/general_functions/getopt.phpt
+++ /dev/null
@@ -1,30 +0,0 @@
---TEST--
-getopt
---ARGS--
--v -h -d test -m 1234 -t -j
---INI--
-register_argc_argv=On
-variables_order=GPS
---SKIPIF--
-<?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip getopt() is currently not available on Windows');
- }
-?>
---FILE--
-<?php
- var_dump(getopt("d:m:j:vht"));
-?>
---EXPECT--
-array(5) {
- ["v"]=>
- bool(false)
- ["h"]=>
- bool(false)
- ["d"]=>
- string(4) "test"
- ["m"]=>
- string(4) "1234"
- ["t"]=>
- bool(false)
-}
diff --git a/ext/standard/tests/general_functions/highlight_heredoc.phpt b/ext/standard/tests/general_functions/highlight_heredoc.phpt
deleted file mode 100644
index 89834a2709..0000000000
--- a/ext/standard/tests/general_functions/highlight_heredoc.phpt
+++ /dev/null
@@ -1,19 +0,0 @@
---TEST--
-highlight_string() handling of heredoc
---FILE--
-<?php
-$str = '
-$x=<<<DD
-jhdsjkfhjdsh
-DD
-."";
-$a=<<<DDDD
-jhdsjkfhjdsh
-DDDD;
-';
-highlight_string($str);
-?>
---EXPECT--
-<code><font color="#000000">
-<br />$x=&lt;&lt;&lt;DD<br />jhdsjkfhjdsh<br />DD<br />."";<br />$a=&lt;&lt;&lt;DDDD<br />jhdsjkfhjdsh<br />DDDD;<br /></font>
-</code>
diff --git a/ext/standard/tests/general_functions/proc_open.phpt b/ext/standard/tests/general_functions/proc_open.phpt
deleted file mode 100644
index 0cd08bd6b2..0000000000
--- a/ext/standard/tests/general_functions/proc_open.phpt
+++ /dev/null
@@ -1,30 +0,0 @@
---TEST--
-proc_open
---SKIPIF--
-<?php # vim:syn=php
-if (!is_executable("/bin/cat")) echo "skip";
-if (!function_exists("proc_open")) echo "skip proc_open() is not available";
-?>
---POST--
---GET--
---FILE--
-<?php
-$ds = array(
- 0 => array("pipe", "r"),
- 1 => array("pipe", "w"),
- 2 => array("pipe", "w")
- );
-
-$cat = proc_open(
- "/bin/cat",
- $ds,
- $pipes
- );
-
-proc_close($cat);
-
-echo "I didn't segfault!\n";
-
-?>
---EXPECT--
-I didn't segfault!
diff --git a/ext/standard/tests/general_functions/sunfuncts.phpt b/ext/standard/tests/general_functions/sunfuncts.phpt
deleted file mode 100644
index 7000c8892a..0000000000
--- a/ext/standard/tests/general_functions/sunfuncts.phpt
+++ /dev/null
@@ -1,44 +0,0 @@
---TEST--
-date_sunrise() and date_sunset() functions
---INI--
-precision=14
---FILE--
-<?php
-
-putenv ("TZ=Asia/Jerusalem");
-
-for($a=1;$a<=12;$a++){
- echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." ";
- echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." ";
- echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
-
- echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." ";
- echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." ";
- echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
-}
-?>
---EXPECT--
-1041293199 06:39 6.6524557618962
-1041293806 16:46 16.769374867459
-1043971592 06:32 6.5453702926602
-1043972233 17:13 17.217524708736
-1046390766 06:06 6.1156526756851
-1046391456 17:36 17.6108549623
-1049069128 05:28 5.4727420290691
-1049069878 17:58 17.972552584375
-1051661094 04:54 4.9012299828593
-1051661898 18:18 18.313688769483
-1054339474 04:34 4.5744292894498
-1054340319 18:39 18.656400943241
-1056931476 04:36 4.6161204505189
-1056932328 18:48 18.808871657766
-1059609894 04:54 4.9068825098364
-1059610715 18:35 18.599286002028
-1062288314 05:14 5.2368895570738
-1062289083 18:03 18.060541787879
-1064880332 05:32 5.542366581139
-1064881044 17:24 17.411505614917
-1067558754 05:54 5.9162088420581
-1067559410 16:50 16.833698570628
-1070150780 06:20 6.3462215520697
-1070151395 16:35 16.583589055537