Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
File_SearchReplace bug or feature with search string and replace array
3
--SKIPIF--
4
<?php
5
include(dirname(__FILE__).'/setup.php');
6
print $status;
7
?>
8
--FILE--
9
<?php
10
require_once(dirname(__FILE__).'/setup.php');
11
 
12
$search = "Copyright (c) 2002-2003,";
13
$replace[] = "Copyprotected.";
14
$replace[] = "Copystuff 2005";
15
$replace[] = "Eat upon perusal";
16
 
17
$snr = new File_SearchReplace( $search, $replace, $files);
18
$snr -> doSearch() ;
19
 
20
foreach($files as $f) {
21
   readfile($f);
22
};
23
 
24
echo "\n------[Occurences]: " . $snr->getNumOccurences();
25
echo "\n------[Last Error]: " , ($snr->getLastError() !== '') ? var_dump($snr->getLastError()) : "N/A";
26
 
27
 
28
?>
29
--EXPECT--
30
<?php
31
// +-----------------------------------------------------------------------+
32
// | Copyprotected. Richard Heyes                                |
33
// | All rights reserved.                                                  |
34
// |                                                                       |/**
35
// +-----------------------------------------------------------------------+
36
// | Copyprotected. Richard Heyes                                |
37
 ...
38
 *
39
 * Search and Replace Utility
40
 *
41
 * @version 1.0
42
 * @package File
43
 */
44
------[Occurences]: 2
45
------[Last Error]: N/A