cvs: pear /File_SearchReplace/tests 09ereg_mm.phpt
| From: | anatoly techtonik | Date: | Fri, 11 Mar 2005 18:39:03 +0000 |
| Subject: | cvs: pear /File_SearchReplace/tests 09ereg_mm.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-30216@lists.php.net to get a copy of this message | ||
techtonik Fri Mar 11 13:39:03 2005 EDT
Added files:
/pear/File_SearchReplace/tests 09ereg_mm.phpt
Log:
* Array arguments in ereg_replace
http://cvs.php.net/co.php/pear/File_SearchReplace/tests/09ereg_mm.phpt?r=1.1&p=1
Index: pear/File_SearchReplace/tests/09ereg_mm.phpt
+++ pear/File_SearchReplace/tests/09ereg_mm.phpt
--TEST--
File_SearchReplace multiple files with search/replace pairs in array
--SKIPIF--
<?php
include('./setup.php');
print $status;
?>
--FILE--
<?php
require_once('./setup.php');
$search[] = "[opyright]+";
$replace[] = "oOoOo";
$search[] = "\* @([a-zO]+) ([0-9.]+)";
$replace[] = "* \\2 \\1";
$search[] = "\*";
$replace[] = "o";
$snr = new File_SearchReplace( $search, $replace, $files);
$snr -> setSearchFunction('ereg');
$snr -> doSearch() ;
foreach($files as $f) {
readfile($f);
};
echo "\n------[Occurences]: " . $snr->getNumOccurences();
echo "\n------[Last Error]: " , ($snr->getLastError() !== '') ?
var_dump($snr->getLastError()) : "N/A";
?>
--EXPECT--
<?oOoOo
// +-----------------------------------------------------------------------+
// | CoOoOo (c) 2002-2003, RoOoOocoOoOoaoOoOod HeoOoOoes |
// | All oOoOos oOoOoeseoOoOoved. |
// | |/oo
// +-----------------------------------------------------------------------+
// | CoOoOo (c) 2002-2003, RoOoOocoOoOoaoOoOod HeoOoOoes |
...
o
o SeaoOoOocoOoOo and ReoOoOolace UoOoOoloOoOo
o
o 1.0 veoOoOosoOoOon
o @oOoOoackaoOoOoe FoOoOole
o/
------[Occurences]: 33
------[Last Error]: N/A