diff options
author | SVN Migration <svn@php.net> | 2006-10-15 21:09:28 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2006-10-15 21:09:28 +0000 |
commit | 88ec761548b66f58acc1a86cdd0fc164ca925476 (patch) | |
tree | d0af978fa00d83bb1d82c613f66477fbd6bb18aa /ext/pcre/tests | |
parent | 268984b4787e797db6054313fc9ba3b9e845306e (diff) | |
download | php-git-PECL_OPENSSL.tar.gz |
This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'.PECL_OPENSSL
Diffstat (limited to 'ext/pcre/tests')
33 files changed, 0 insertions, 1446 deletions
diff --git a/ext/pcre/tests/backtrack_limit.phpt b/ext/pcre/tests/backtrack_limit.phpt deleted file mode 100644 index ebfd720c3c..0000000000 --- a/ext/pcre/tests/backtrack_limit.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Backtracking limit ---INI-- -pcre.backtrack_limit=2 ---FILE-- -<?php - -var_dump(preg_match_all('/.*\p{N}/', '0123456789', $dummy)); -var_dump(preg_last_error() === PREG_BACKTRACK_LIMIT_ERROR); - -var_dump(preg_match_all('/\p{Nd}/', '0123456789', $dummy)); -var_dump(preg_last_error() === PREG_NO_ERROR); - -?> ---EXPECT-- -int(0) -bool(true) -int(10) -bool(true) diff --git a/ext/pcre/tests/bug20528.phpt b/ext/pcre/tests/bug20528.phpt deleted file mode 100644 index 8182fd9bfe..0000000000 --- a/ext/pcre/tests/bug20528.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #20528 (preg_split() drops characters (re-opens Bug #15413)) ---FILE-- -<?php - $data = '(#11/19/2002#)'; - var_dump(preg_split('/\b/', $data)); -?> ---EXPECT-- -array(7) { - [0]=> - string(2) "(#" - [1]=> - string(2) "11" - [2]=> - string(1) "/" - [3]=> - string(2) "19" - [4]=> - string(1) "/" - [5]=> - string(4) "2002" - [6]=> - string(2) "#)" -} diff --git a/ext/pcre/tests/bug21732.phpt b/ext/pcre/tests/bug21732.phpt deleted file mode 100644 index 3dfc41e19f..0000000000 --- a/ext/pcre/tests/bug21732.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #21732 (preg_replace() segfaults with invalid parameters) ---INI-- -error_reporting=0 ---FILE-- -<?php -class foo { - function cb($param) { - var_dump($param); - return "yes!"; - } -} - -var_dump(preg_replace('', array(), '')); -var_dump(preg_replace_callback("/(ab)(cd)(e)/", array(new foo(), "cb"), 'abcde')); -?> ---EXPECT-- -bool(false) -array(4) { - [0]=> - string(5) "abcde" - [1]=> - string(2) "ab" - [2]=> - string(2) "cd" - [3]=> - string(1) "e" -} -string(4) "yes!" diff --git a/ext/pcre/tests/bug26927.phpt b/ext/pcre/tests/bug26927.phpt deleted file mode 100644 index 5c64deb37c..0000000000 --- a/ext/pcre/tests/bug26927.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #26927 (preg_quote() does not escape \0) ---FILE-- -<?php - $str = "a\000b"; - $str_quoted = preg_quote($str); - var_dump(preg_match("!{$str_quoted}!", $str), $str_quoted); -?> ---EXPECT-- -int(1) -string(6) "a\000b" diff --git a/ext/pcre/tests/bug27103.phpt b/ext/pcre/tests/bug27103.phpt deleted file mode 100644 index 185225d310..0000000000 --- a/ext/pcre/tests/bug27103.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets) ---FILE-- -<?php -function iter($ar) -{ - foreach ($ar as $c) { - echo htmlentities($c, 0, "UTF-8"), ": ", strlen($c), "\n"; - } -} -$teststr = "\xe2\x82\xac hi there"; -iter(preg_split('//u', $teststr, -1, PREG_SPLIT_NO_EMPTY)); -preg_match_all('/./u', $teststr, $matches); -iter($matches[0]); -?> ---EXPECT-- -€: 3 - : 1 -h: 1 -i: 1 - : 1 -t: 1 -h: 1 -e: 1 -r: 1 -e: 1 -€: 3 - : 1 -h: 1 -i: 1 - : 1 -t: 1 -h: 1 -e: 1 -r: 1 -e: 1 - diff --git a/ext/pcre/tests/bug33200.phpt b/ext/pcre/tests/bug33200.phpt deleted file mode 100644 index b00b72ac28..0000000000 --- a/ext/pcre/tests/bug33200.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #33200 (magic_quotes_sybase = On makes 'e' modifier misbehave) ---INI-- -magic_quotes_sybase=1 ---FILE-- -<?php -$str = 'some \'$sample\' text'; -$str = preg_replace("/(some.*text)/e", "strtoupper('\\1')", $str); -echo $str; -?> ---EXPECT-- -SOME '$SAMPLE' TEXT diff --git a/ext/pcre/tests/bug34790.phpt b/ext/pcre/tests/bug34790.phpt deleted file mode 100755 index c375ae5ac8..0000000000 --- a/ext/pcre/tests/bug34790.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #34790 (preg_match_all(), named capturing groups, variable assignment/return => crash) ---FILE-- -<?php -function func1(){ - $string = 'what the word and the other word the'; - preg_match_all('/(?P<word>the)/', $string, $matches); - return $matches['word']; -} -$words = func1(); -var_dump($words); -?> ---EXPECT-- -array(4) { - [0]=> - string(3) "the" - [1]=> - string(3) "the" - [2]=> - string(3) "the" - [3]=> - string(3) "the" -} diff --git a/ext/pcre/tests/bug37800.phpt b/ext/pcre/tests/bug37800.phpt deleted file mode 100644 index e8a0036ebe..0000000000 --- a/ext/pcre/tests/bug37800.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #37800 (preg_replace() limit parameter odd behaviour) ---FILE-- -<?php -$s_string = '1111111111'; -$s_search = '/1/'; -$s_replace = 'One '; -$i_limit = 1; -$i_count = 0; - -$s_output = preg_replace($s_search, $s_replace, $s_string, $i_limit, -$i_count); -echo "Output = " . var_export($s_output, True) . "\n"; -echo "Count = $i_count\n"; -var_dump(preg_last_error() === PREG_NO_ERROR); - -$i_limit = strlen($s_string); -$s_output = preg_replace($s_search, $s_replace, $s_string, $i_limit, -$i_count); -echo "Output = " . var_export($s_output, True) . "\n"; -echo "Count = $i_count\n"; -var_dump(preg_last_error() === PREG_NO_ERROR); - -?> ---EXPECT-- -Output = 'One 111111111' -Count = 1 -bool(true) -Output = 'One One One One One One One One One One ' -Count = 10 -bool(true) diff --git a/ext/pcre/tests/cache_limit.phpt b/ext/pcre/tests/cache_limit.phpt deleted file mode 100644 index bfe7f1b9a9..0000000000 --- a/ext/pcre/tests/cache_limit.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Compiled regex cache limit ---FILE-- -<?php -define('PREG_CACHE_SIZE', 4096+1); - -$re = ''; -$str = str_repeat('x', PREG_CACHE_SIZE); - -for ($i=0; $i < PREG_CACHE_SIZE; ++$i) { - $re .= '.'; - if (!preg_match("/$re/", $str)) { - die('non match. error'); - } -} - -var_dump(preg_match('/./', $str)); // this one was already deleted from the cache -var_dump(preg_match("/$re/", $str)); // but not this one - -echo "done\n"; -?> ---EXPECT-- -int(1) -int(1) -done diff --git a/ext/pcre/tests/delimiters.phpt b/ext/pcre/tests/delimiters.phpt deleted file mode 100644 index 1826f8730a..0000000000 --- a/ext/pcre/tests/delimiters.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Delimiters crash test ---FILE-- -<?php - -var_dump(preg_match('', '')); -var_dump(preg_match(' ', '')); -var_dump(preg_match('@@', '')); -var_dump(preg_match('12', '')); -var_dump(preg_match('<>', '')); -var_dump(preg_match('~a', '')); -var_dump(preg_match('@\@\@@', '@@')); -var_dump(preg_match('//z', '@@')); -var_dump(preg_match('{', '')); - -?> ---EXPECTF-- -Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 3 -bool(false) - -Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 4 -bool(false) -int(1) - -Warning: preg_match(): Delimiter must not be alphanumeric or backslash in %sdelimiters.php on line 6 -bool(false) -int(1) - -Warning: preg_match(): No ending delimiter '~' found in %sdelimiters.php on line 8 -bool(false) -int(1) - -Warning: preg_match(): Unknown modifier 'z' in %sdelimiters.php on line 10 -bool(false) - -Warning: preg_match(): No ending matching delimiter '}' found in %sdelimiters.php on line 11 -bool(false) diff --git a/ext/pcre/tests/dollar_endonly.phpt b/ext/pcre/tests/dollar_endonly.phpt deleted file mode 100644 index 96a52441df..0000000000 --- a/ext/pcre/tests/dollar_endonly.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -D (PCRE_DOLLAR_ENDONLY) modififer ---FILE-- -<?php - -var_dump(preg_match_all('/^\S+.+$/', "aeiou\n", $m)); -var_dump($m); - -var_dump(preg_match_all('/^\S+.+$/D', "aeiou\n", $m)); -var_dump($m); - -var_dump(preg_match_all('/^\S+\s$/D', "aeiou\n", $m)); -var_dump($m); - -?> ---EXPECT-- -int(1) -array(1) { - [0]=> - array(1) { - [0]=> - string(5) "aeiou" - } -} -int(0) -array(1) { - [0]=> - array(0) { - } -} -int(1) -array(1) { - [0]=> - array(1) { - [0]=> - string(6) "aeiou -" - } -} diff --git a/ext/pcre/tests/grep.phpt b/ext/pcre/tests/grep.phpt deleted file mode 100644 index d3d9032e49..0000000000 --- a/ext/pcre/tests/grep.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -preg_grep() ---FILE-- -<?php -$array = array('a', '1', 'q6', 'h20'); - -var_dump(preg_grep('/^(\d|.\d)$/', $array)); -var_dump(preg_grep('/^(\d|.\d)$/', $array, PREG_GREP_INVERT)); - -?> ---EXPECT-- -array(2) { - [1]=> - string(1) "1" - [2]=> - string(2) "q6" -} -array(2) { - [0]=> - string(1) "a" - [3]=> - string(3) "h20" -} diff --git a/ext/pcre/tests/grep2.phpt b/ext/pcre/tests/grep2.phpt deleted file mode 100644 index 0cf8d4aebc..0000000000 --- a/ext/pcre/tests/grep2.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -preg_grep() 2nd test ---FILE-- -<?php - -var_dump(preg_grep(1,array(),3,4)); -var_dump(preg_grep(1, 2)); -var_dump(preg_grep('/+/', array())); - -$array = array(5=>'a', 'x' => '1', 'xyz'=>'q6', 'h20'); - -var_dump(preg_grep('@^[a-z]+@', $array)); -var_dump(preg_grep('@^[a-z]+@', $array, PREG_GREP_INVERT)); - -ini_set('pcre.recursion_limit', 1); -var_dump(preg_last_error() == PREG_NO_ERROR); -var_dump(preg_grep('@^[a-z]+@', $array)); -var_dump(preg_last_error() == PREG_RECURSION_LIMIT_ERROR); - -?> ---EXPECTF-- -Warning: preg_grep() expects at most 3 parameters, 4 given in %sgrep2.php on line 3 -NULL - -Warning: preg_grep() expects parameter 2 to be array, integer given in %sgrep2.php on line 4 -NULL - -Warning: preg_grep(): Compilation failed: nothing to repeat at offset 0 in %sgrep2.php on line 5 -bool(false) -array(3) { - [5]=> - string(1) "a" - ["xyz"]=> - string(2) "q6" - [6]=> - string(3) "h20" -} -array(1) { - ["x"]=> - string(1) "1" -} -bool(true) -array(0) { -} -bool(true) diff --git a/ext/pcre/tests/invalid_utf8.phpt b/ext/pcre/tests/invalid_utf8.phpt deleted file mode 100644 index df2de2da9b..0000000000 --- a/ext/pcre/tests/invalid_utf8.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -preg_replace() and invalid UTF8 ---FILE-- -<?php - -$string = urldecode("search%e4"); -$result = preg_replace("#(&\#x*)([0-9A-F]+);*#iu","$1$2;",$string); -var_dump($result); -var_dump(preg_last_error()); - -echo "Done\n"; -?> ---EXPECT-- -NULL -int(4) -Done diff --git a/ext/pcre/tests/locales.phpt b/ext/pcre/tests/locales.phpt deleted file mode 100644 index 6b600236cf..0000000000 --- a/ext/pcre/tests/locales.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Localized match ---SKIPIF-- -<?php if (!function_exists('setlocale')) die('skip: setlocale() not available'); ?> -<?php if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available'); ---FILE-- -<?php - -// this tests if the cache is working correctly, as the char tables -// must be rebuilt after the locale change - -setlocale(LC_ALL, 'C', 'POSIX'); -var_dump(preg_match('/^\w{6}$/', 'aאבחיט')); - -setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese'); -var_dump(preg_match('/^\w{6}$/', 'aאבחיט')); - -setlocale(LC_ALL, 'C', 'POSIX'); -var_dump(preg_match('/^\w{6}$/', 'aאבחיט')); - -?> ---EXPECT-- -int(0) -int(1) -int(0) diff --git a/ext/pcre/tests/match_flags.phpt b/ext/pcre/tests/match_flags.phpt deleted file mode 100644 index ddd36bf9ba..0000000000 --- a/ext/pcre/tests/match_flags.phpt +++ /dev/null @@ -1,127 +0,0 @@ ---TEST-- -preg_match_all() flags ---FILE-- -<?php - -var_dump(preg_match_all('/(.)x/', 'zxax', $match, PREG_PATTERN_ORDER)); -var_dump($match); - -var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_SET_ORDER)); -var_dump($match); - -var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_OFFSET_CAPTURE)); -var_dump($match); - -var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)); -var_dump($match); - -?> ---EXPECT-- -int(2) -array(2) { - [0]=> - array(2) { - [0]=> - string(2) "zx" - [1]=> - string(2) "ax" - } - [1]=> - array(2) { - [0]=> - string(1) "z" - [1]=> - string(1) "a" - } -} -int(2) -array(2) { - [0]=> - array(2) { - [0]=> - string(2) "zx" - [1]=> - string(1) "z" - } - [1]=> - array(2) { - [0]=> - string(2) "yx" - [1]=> - string(1) "y" - } -} -int(2) -array(2) { - [0]=> - array(2) { - [0]=> - array(2) { - [0]=> - string(2) "zx" - [1]=> - int(0) - } - [1]=> - array(2) { - [0]=> - string(2) "yx" - [1]=> - int(2) - } - } - [1]=> - array(2) { - [0]=> - array(2) { - [0]=> - string(1) "z" - [1]=> - int(0) - } - [1]=> - array(2) { - [0]=> - string(1) "y" - [1]=> - int(2) - } - } -} -int(2) -array(2) { - [0]=> - array(2) { - [0]=> - array(2) { - [0]=> - string(2) "zx" - [1]=> - int(0) - } - [1]=> - array(2) { - [0]=> - string(1) "z" - [1]=> - int(0) - } - } - [1]=> - array(2) { - [0]=> - array(2) { - [0]=> - string(2) "yx" - [1]=> - int(2) - } - [1]=> - array(2) { - [0]=> - string(1) "y" - [1]=> - int(2) - } - } -} diff --git a/ext/pcre/tests/match_flags2.phpt b/ext/pcre/tests/match_flags2.phpt deleted file mode 100644 index f703091735..0000000000 --- a/ext/pcre/tests/match_flags2.phpt +++ /dev/null @@ -1,95 +0,0 @@ ---TEST-- -preg_match() flags ---FILE-- -<?php - -var_dump(preg_match('/x(.)/', 'fjszxax', $match, PREG_OFFSET_CAPTURE)); -var_dump($match); - -var_dump(preg_match('/(.)x/', 'fjszxax', $match, PREG_OFFSET_CAPTURE, 4)); -var_dump($match); - -var_dump(preg_match('/(?P<capt1>.)(x)(?P<letsmix>\S+)/', 'fjszxax', $match, PREG_OFFSET_CAPTURE)); -var_dump($match); - -?> ---EXPECT-- -int(1) -array(2) { - [0]=> - array(2) { - [0]=> - string(2) "xa" - [1]=> - int(4) - } - [1]=> - array(2) { - [0]=> - string(1) "a" - [1]=> - int(5) - } -} -int(1) -array(2) { - [0]=> - array(2) { - [0]=> - string(2) "ax" - [1]=> - int(5) - } - [1]=> - array(2) { - [0]=> - string(1) "a" - [1]=> - int(5) - } -} -int(1) -array(6) { - [0]=> - array(2) { - [0]=> - string(4) "zxax" - [1]=> - int(3) - } - ["capt1"]=> - array(2) { - [0]=> - string(1) "z" - [1]=> - int(3) - } - [1]=> - array(2) { - [0]=> - string(1) "z" - [1]=> - int(3) - } - [2]=> - array(2) { - [0]=> - string(1) "x" - [1]=> - int(4) - } - ["letsmix"]=> - array(2) { - [0]=> - string(2) "ax" - [1]=> - int(5) - } - [3]=> - array(2) { - [0]=> - string(2) "ax" - [1]=> - int(5) - } -} diff --git a/ext/pcre/tests/match_flags3.phpt b/ext/pcre/tests/match_flags3.phpt deleted file mode 100644 index f22205e3d8..0000000000 --- a/ext/pcre/tests/match_flags3.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -preg_match() flags 3 ---FILE-- -<?php - -var_dump(preg_match('', '', $match, 0xfff)); - -var_dump(preg_match('/\d+/', '123 456 789 012', $match, 0, -8)); -var_dump($match); - -var_dump(preg_match('/\d+/', '123 456 789 012', $match, 0, -500)); -var_dump($match); - -var_dump(preg_match_all('/\d+/', '123 456 789 012', $match, 0, -8)); -var_dump($match); - -var_dump(preg_match('/(?P<3>)/', '')); - -?> ---EXPECTF-- - -Warning: preg_match(): Empty regular expression in %smatch_flags3.php on line 3 -bool(false) -int(1) -array(1) { - [0]=> - string(3) "789" -} -int(1) -array(1) { - [0]=> - string(3) "123" -} -int(2) -array(1) { - [0]=> - array(2) { - [0]=> - string(3) "789" - [1]=> - string(3) "012" - } -} - -Warning: preg_match(): Numeric named subpatterns are not allowed in %smatch_flags3.php on line 14 -bool(false) diff --git a/ext/pcre/tests/multiline.phpt b/ext/pcre/tests/multiline.phpt deleted file mode 100644 index 356800917b..0000000000 --- a/ext/pcre/tests/multiline.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Multi-line match ---FILE-- -<?php - -var_dump(preg_match_all('/^.{2,3}$/', "aei\nou", $dummy)); -var_dump(preg_match_all('/^.{2,3}$/', "aei\nou\n", $dummy)); -var_dump(preg_match_all('/^.{2,3}$/m', "aei\nou", $dummy)); -var_dump(preg_match_all('/^.{2,3}$/m', "aei\nou\n", $dummy)); - -echo "done\n"; -?> ---EXPECT-- -int(0) -int(0) -int(2) -int(2) -done diff --git a/ext/pcre/tests/pcre_anchored.phpt b/ext/pcre/tests/pcre_anchored.phpt deleted file mode 100644 index caa96437e1..0000000000 --- a/ext/pcre/tests/pcre_anchored.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -A (PCRE_ANCHORED) modififer ---FILE-- -<?php - -var_dump(preg_match('/\PN+/', '123abc', $m)); -var_dump($m); - -var_dump(preg_match('/\P{N}+/A', '123abc')); -var_dump(preg_match('/^\P{N}+/', '123abc')); -var_dump(preg_match('/^\P{N}+/A', '123abc')); - -?> ---EXPECT-- -int(1) -array(1) { - [0]=> - string(3) "abc" -} -int(0) -int(0) -int(0) diff --git a/ext/pcre/tests/pcre_count.phpt b/ext/pcre/tests/pcre_count.phpt deleted file mode 100644 index 1239d48ffb..0000000000 --- a/ext/pcre/tests/pcre_count.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -preg_replace() fifth parameter - count ---FILE-- -<?php -$regex = '/(([0-9a-z]+)-([0-9]+))-(([0-9]+)-([0-9]+))/'; - -$string= '1-2-3-4 a-2-3-4 1-a-3-4 1-2-a-4 1-2-3-a a-a-a-a 4-3-2-1 100-200-300-400-500-600-700-800'; -$count = 0; -var_dump(preg_replace($regex, 'xxxx', $string, -1, $count)); -var_dump($count); -////////////////////////////////////////////////////// - -$regex = '/([a-z]+)/'; - -$string= 'Here must only number like 42 and 13 appear'; -var_dump(preg_replace($regex, 'xxxx', $string, -1, $count)); -var_dump($count); - -//////////////////////////////////////////////////////// -$regex = '~((V(I|1)(4|A)GR(4|A))|(V(I|1)C(0|O)D(I|1)(N|\/\\\/)))~i'; - -$string= 'Viagra V14GR4 Vicodin V1C0D1/\/ v1c0d1/|/'; -var_dump(preg_replace($regex, '...', $string, -1, $count)); -var_dump($count); -//////////////////////////////////////////////////////// -$regex = '~((V(I|1)(4|A)GR(4|A))|(V(I|1)C(0|O)D(I|1)(N|\/\\\/)))~i'; -$count = NULL; -$string= 'Viagra V14GR4 Vicodin V1C0D1/\/ v1c0d1/|/'; -var_dump(preg_replace($regex, '...', $string, -1)); -var_dump($count); -?> ---EXPECT-- -string(56) "xxxx xxxx 1-a-3-4 1-2-a-4 1-2-3-a a-a-a-a xxxx xxxx-xxxx" -int(5) -string(41) "Hxxxx xxxx xxxx xxxx xxxx 42 xxxx 13 xxxx" -int(7) -string(25) "... ... ... ... v1c0d1/|/" -int(4) -string(25) "... ... ... ... v1c0d1/|/" -NULL diff --git a/ext/pcre/tests/pcre_extended.phpt b/ext/pcre/tests/pcre_extended.phpt deleted file mode 100644 index 6c4b20e7f0..0000000000 --- a/ext/pcre/tests/pcre_extended.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -x (PCRE_EXTENDED) modififer ---FILE-- -<?php - -var_dump(preg_match('/a e i o u/', 'aeiou', $m)); -var_dump($m); - -var_dump(preg_match('/a e i o u/x', 'aeiou', $m)); -var_dump($m); - -var_dump(preg_match("/a e\ni\to\ru/x", 'aeiou', $m)); -var_dump($m); - -?> ---EXPECT-- -int(0) -array(0) { -} -int(1) -array(1) { - [0]=> - string(5) "aeiou" -} -int(1) -array(1) { - [0]=> - string(5) "aeiou" -} diff --git a/ext/pcre/tests/pcre_extra.phpt b/ext/pcre/tests/pcre_extra.phpt deleted file mode 100644 index 2bee408fbf..0000000000 --- a/ext/pcre/tests/pcre_extra.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -X (PCRE_EXTRA) modififer ---FILE-- -<?php - -var_dump(preg_match('/\y/', '\y')); -var_dump(preg_match('/\y/X', '\y')); - -?> ---EXPECTF-- -int(1) - -Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in %spcre_extra.php on line 4 -bool(false) diff --git a/ext/pcre/tests/preg_replace.phpt b/ext/pcre/tests/preg_replace.phpt deleted file mode 100644 index f7b5f74157..0000000000 --- a/ext/pcre/tests/preg_replace.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -preg_replace() ---FILE-- -<?php - -var_dump(preg_replace('{{\D+}}', 'x', '{abcd}')); -var_dump(preg_replace('{{\D+}}', 'ddd', 'abcd')); - -var_dump(preg_replace('/(ab)(c)(d)(e)(f)(g)(h)(i)(j)(k)/', 'a${1}2$103', 'zabcdefghijkl')); - -var_dump(preg_replace_callback('//e', '', '')); - -var_dump(preg_replace_callback('//e', 'strtolower', '')); - -?> ---EXPECTF-- -string(1) "x" -string(4) "abcd" -string(8) "zaab2k3l" - -Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %spreg_replace.php on line 8 -string(0) "" - -Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in %spreg_replace.php on line 10 -NULL diff --git a/ext/pcre/tests/preg_replace2.phpt b/ext/pcre/tests/preg_replace2.phpt deleted file mode 100644 index 4e2f39f8ca..0000000000 --- a/ext/pcre/tests/preg_replace2.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -preg_replace() ---FILE-- -<?php - -var_dump(preg_replace('', array(), '')); - -var_dump(preg_replace(array('/\da(.)/ui', '@..@'), '$1', '12Abc')); -var_dump(preg_replace(array('/\da(.)/ui', '@(.)@'), '$1', array('x','a2aA', '1av2Ab'))); - - -var_dump(preg_replace(array('/[\w]+/'), array('$'), array('xyz', 'bdbd'))); -var_dump(preg_replace(array('/\s+/', '~[b-d]~'), array('$'), array('x y', 'bd bc'))); - -echo "==done==\n"; - -?> ---EXPECTF-- -Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement is an array in %spreg_replace2.php on line 3 -bool(false) -string(1) "c" -array(3) { - [0]=> - string(1) "x" - [1]=> - string(2) "aA" - [2]=> - string(2) "vb" -} -array(2) { - [0]=> - string(1) "$" - [1]=> - string(1) "$" -} -array(2) { - [0]=> - string(3) "x$y" - [1]=> - string(1) "$" -} -==done== diff --git a/ext/pcre/tests/preg_replace_callback.phpt b/ext/pcre/tests/preg_replace_callback.phpt deleted file mode 100644 index 0b0bc27576..0000000000 --- a/ext/pcre/tests/preg_replace_callback.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -preg_replace_callback() ---FILE-- -<?php -$input = "plain [indent] deep [indent] [abcd]deeper[/abcd] [/indent] deep [/indent] plain"; - -function parseTagsRecursive($input) -{ - - $regex = '#\[indent]((?:[^[]|\[(?!/?indent])|(?R))+)\[/indent]#'; - - if (is_array($input)) { - $input = '<div style="margin-left: 10px">'.$input[1].'</div>'; - } - - return preg_replace_callback($regex, 'parseTagsRecursive', $input); -} - -$output = parseTagsRecursive($input); - -echo $output, "\n"; - -?> ---EXPECT-- -plain <div style="margin-left: 10px"> deep <div style="margin-left: 10px"> [abcd]deeper[/abcd] </div> deep </div> plain diff --git a/ext/pcre/tests/preg_replace_callback2.phpt b/ext/pcre/tests/preg_replace_callback2.phpt deleted file mode 100644 index a7f5a362dc..0000000000 --- a/ext/pcre/tests/preg_replace_callback2.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -preg_replace_callback() 2 ---FILE-- -<?php - -function f() { - throw new Exception(); -} - -try { -var_dump(preg_replace_callback('/\w/', 'f', 'z')); -} catch(Exception $e) {} - -function g($x) { - return "'$x[0]'"; -} - -var_dump(preg_replace_callback('@\b\w{1,2}\b@', 'g', array('a b3 bcd', 'v' => 'aksfjk', 12 => 'aa bb'))); - -var_dump(preg_replace_callback('~\A.~', 'g', array(array('xyz')))); - -var_dump(preg_replace_callback('~\A.~', create_function('$m', 'return strtolower($m[0]);'), 'ABC')); -?> ---EXPECTF-- -Warning: preg_replace_callback(): Unable to call custom replacement function in %spreg_replace_callback2.php on line %d -array(3) { - [0]=> - string(12) "'a' 'b3' bcd" - ["v"]=> - string(6) "aksfjk" - [12]=> - string(9) "'aa' 'bb'" -} - -Notice: Array to string conversion in %spreg_replace_callback2.php on line 17 -array(1) { - [0]=> - string(7) "'A'rray" -} -string(3) "aBC" diff --git a/ext/pcre/tests/preg_replace_callback3.phpt b/ext/pcre/tests/preg_replace_callback3.phpt deleted file mode 100644 index fafd966f47..0000000000 --- a/ext/pcre/tests/preg_replace_callback3.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -preg_replace_callback() 3 ---FILE-- -<?php - -var_dump(preg_replace_callback()); -var_dump(preg_replace_callback(1)); -var_dump(preg_replace_callback(1,2)); -var_dump(preg_replace_callback(1,2,3)); -var_dump(preg_replace_callback(1,2,3,4)); -$a = 5; -var_dump(preg_replace_callback(1,2,3,4,$a)); -$a = ""; -var_dump(preg_replace_callback("","","","",$a)); -$a = array(); -var_dump(preg_replace_callback($a,$a,$a,$a,$a)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d -NULL - -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d -NULL - -Warning: Wrong parameter count for preg_replace_callback() in %s on line %d -NULL - -Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d -int(3) - -Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d -int(3) - -Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d -int(3) - -Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %s on line 1%d -string(0) "" - -Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in %s on line %d -array(0) { -} -Done diff --git a/ext/pcre/tests/recursion_limit.phpt b/ext/pcre/tests/recursion_limit.phpt deleted file mode 100644 index 2a43aa27d6..0000000000 --- a/ext/pcre/tests/recursion_limit.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -PCRE Recursion limit ---INI-- -pcre.recursion_limit=2 ---FILE-- -<?php - -var_dump(preg_match_all('/\p{Ll}(\p{L}((\p{Ll}\p{Ll})))/', 'aeiou', $dummy)); -var_dump(preg_last_error() === PREG_RECURSION_LIMIT_ERROR); - -var_dump(preg_match_all('/\p{Ll}\p{L}\p{Ll}\p{Ll}/', 'aeiou', $dummy)); -var_dump(preg_last_error() === PREG_NO_ERROR); - -?> ---EXPECT-- -int(0) -bool(true) -int(1) -bool(true) diff --git a/ext/pcre/tests/split.phpt b/ext/pcre/tests/split.phpt deleted file mode 100644 index 8ec8e655cf..0000000000 --- a/ext/pcre/tests/split.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -preg_split() ---FILE-- -<?php - -var_dump(preg_split()); -var_dump(preg_split('/*/', 'x')); - -var_dump(preg_split('/[\s, ]+/', 'x yy,zzz')); -var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', -1)); -var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 0)); -var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 1)); -var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 2)); - -var_dump(preg_split('/\d*/', 'ab2c3u')); -var_dump(preg_split('/\d*/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY)); - -?> ---EXPECTF-- -Warning: preg_split() expects at least 2 parameters, 0 given in %ssplit.php on line 3 -bool(false) - -Warning: preg_split(): Compilation failed: nothing to repeat at offset 0 in %ssplit.php on line 4 -bool(false) -array(3) { - [0]=> - string(1) "x" - [1]=> - string(2) "yy" - [2]=> - string(3) "zzz" -} -array(3) { - [0]=> - string(1) "x" - [1]=> - string(2) "yy" - [2]=> - string(3) "zzz" -} -array(3) { - [0]=> - string(1) "x" - [1]=> - string(2) "yy" - [2]=> - string(3) "zzz" -} -array(1) { - [0]=> - string(8) "x yy,zzz" -} -array(2) { - [0]=> - string(1) "x" - [1]=> - string(6) "yy,zzz" -} -array(8) { - [0]=> - string(0) "" - [1]=> - string(1) "a" - [2]=> - string(1) "b" - [3]=> - string(0) "" - [4]=> - string(1) "c" - [5]=> - string(0) "" - [6]=> - string(1) "u" - [7]=> - string(0) "" -} -array(4) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" - [3]=> - string(1) "u" -} diff --git a/ext/pcre/tests/split2.phpt b/ext/pcre/tests/split2.phpt deleted file mode 100644 index 391acb951e..0000000000 --- a/ext/pcre/tests/split2.phpt +++ /dev/null @@ -1,315 +0,0 @@ ---TEST-- -preg_split() 2nd test ---FILE-- -<?php - -var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_DELIM_CAPTURE)); -var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_OFFSET_CAPTURE)); -var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)); -var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE));; -var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE)); -var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE)); - - -var_dump(preg_last_error(1)); -ini_set('pcre.recursion_limit', 1); -var_dump(preg_last_error() == PREG_NO_ERROR); -var_dump(preg_split('/(\d*)/', 'ab2c3u')); -var_dump(preg_last_error() == PREG_RECURSION_LIMIT_ERROR); - -?> ---EXPECTF-- -array(15) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(1) "a" - [3]=> - string(0) "" - [4]=> - string(1) "b" - [5]=> - string(1) "2" - [6]=> - string(0) "" - [7]=> - string(0) "" - [8]=> - string(1) "c" - [9]=> - string(1) "3" - [10]=> - string(0) "" - [11]=> - string(0) "" - [12]=> - string(1) "u" - [13]=> - string(0) "" - [14]=> - string(0) "" -} -array(8) { - [0]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(0) - } - [1]=> - array(2) { - [0]=> - string(1) "a" - [1]=> - int(0) - } - [2]=> - array(2) { - [0]=> - string(1) "b" - [1]=> - int(1) - } - [3]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(3) - } - [4]=> - array(2) { - [0]=> - string(1) "c" - [1]=> - int(3) - } - [5]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(5) - } - [6]=> - array(2) { - [0]=> - string(1) "u" - [1]=> - int(5) - } - [7]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(6) - } -} -array(6) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "2" - [3]=> - string(1) "c" - [4]=> - string(1) "3" - [5]=> - string(1) "u" -} -array(4) { - [0]=> - array(2) { - [0]=> - string(1) "a" - [1]=> - int(0) - } - [1]=> - array(2) { - [0]=> - string(1) "b" - [1]=> - int(1) - } - [2]=> - array(2) { - [0]=> - string(1) "c" - [1]=> - int(3) - } - [3]=> - array(2) { - [0]=> - string(1) "u" - [1]=> - int(5) - } -} -array(15) { - [0]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(0) - } - [1]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(0) - } - [2]=> - array(2) { - [0]=> - string(1) "a" - [1]=> - int(0) - } - [3]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(1) - } - [4]=> - array(2) { - [0]=> - string(1) "b" - [1]=> - int(1) - } - [5]=> - array(2) { - [0]=> - string(1) "2" - [1]=> - int(2) - } - [6]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(3) - } - [7]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(3) - } - [8]=> - array(2) { - [0]=> - string(1) "c" - [1]=> - int(3) - } - [9]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - int(4) - } - [10]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(5) - } - [11]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(5) - } - [12]=> - array(2) { - [0]=> - string(1) "u" - [1]=> - int(5) - } - [13]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(6) - } - [14]=> - array(2) { - [0]=> - string(0) "" - [1]=> - int(6) - } -} -array(6) { - [0]=> - array(2) { - [0]=> - string(1) "a" - [1]=> - int(0) - } - [1]=> - array(2) { - [0]=> - string(1) "b" - [1]=> - int(1) - } - [2]=> - array(2) { - [0]=> - string(1) "2" - [1]=> - int(2) - } - [3]=> - array(2) { - [0]=> - string(1) "c" - [1]=> - int(3) - } - [4]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - int(4) - } - [5]=> - array(2) { - [0]=> - string(1) "u" - [1]=> - int(5) - } -} - -Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d -NULL -bool(true) -array(1) { - [0]=> - string(6) "ab2c3u" -} -bool(true) diff --git a/ext/pcre/tests/study.phpt b/ext/pcre/tests/study.phpt deleted file mode 100644 index 696a4c0ef0..0000000000 --- a/ext/pcre/tests/study.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Study regex ---FILE-- -<?php - -var_dump(preg_match('/(?:(?:(?:(?:(?:(.))))))/ S', 'aeiou', $dump)); -var_dump($dump[1]); -var_dump(preg_match('/(?:(?:(?:(?:(?:(.))))))/', 'aeiou', $dump)); -var_dump($dump[1]); - -var_dump(preg_match('/(?>..)((?:(?>.)|.|.|.|u))/S', 'aeiou', $dump)); -var_dump($dump[1]); - -// try to trigger usual "match known text" optimization -var_dump(preg_match('/^aeiou$/S', 'aeiou', $dump)); -var_dump($dump[0]); -var_dump(preg_match('/aeiou/S', 'aeiou', $dump)); -var_dump($dump[0]); - -?> ---EXPECT-- -int(1) -string(1) "a" -int(1) -string(1) "a" -int(1) -string(1) "i" -int(1) -string(5) "aeiou" -int(1) -string(5) "aeiou" diff --git a/ext/pcre/tests/ungreedy.phpt b/ext/pcre/tests/ungreedy.phpt deleted file mode 100644 index cf5e8adafd..0000000000 --- a/ext/pcre/tests/ungreedy.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -U (PCRE_UNGREEDY) modififer ---FILE-- -<?php - -var_dump(preg_match('/<.*>/', '<aa> <bb> <cc>', $m)); -var_dump($m); - -var_dump(preg_match('/<.*>/U', '<aa> <bb> <cc>', $m)); -var_dump($m); - -var_dump(preg_match('/(?U)<.*>/', '<aa> <bb> <cc>', $m)); -var_dump($m); - -?> ---EXPECT-- -int(1) -array(1) { - [0]=> - string(14) "<aa> <bb> <cc>" -} -int(1) -array(1) { - [0]=> - string(4) "<aa>" -} -int(1) -array(1) { - [0]=> - string(4) "<aa>" -} |