cvs: pear /PHPUnit2/Util Filter.php
| From: | Sebastian Bergmann | Date: | Fri, 24 Feb 2006 12:06:47 +0000 |
| Subject: | cvs: pear /PHPUnit2/Util Filter.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38561@lists.php.net to get a copy of this message | ||
sebastian Fri Feb 24 12:06:47 2006 UTC
Modified files:
/pear/PHPUnit2/Util Filter.php
Log:
Cleanup.
http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Filter.php?r1=1.50&r2=1.51&diff_format=u
Index: pear/PHPUnit2/Util/Filter.php
diff -u pear/PHPUnit2/Util/Filter.php:1.50 pear/PHPUnit2/Util/Filter.php:1.51
--- pear/PHPUnit2/Util/Filter.php:1.50 Wed Jan 18 08:46:58 2006
+++ pear/PHPUnit2/Util/Filter.php Fri Feb 24 12:06:47 2006
@@ -41,7 +41,7 @@
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.opensource.org/licenses/bsd-license.php
BSD License
- * @version CVS: $Id: Filter.php,v 1.50 2006/01/18 08:46:58 sebastian Exp $
+ * @version CVS: $Id: Filter.php,v 1.51 2006/02/24 12:06:47 sebastian Exp $
* @link http://pear.php.net/package/PHPUnit2
* @since File available since Release 2.0.0
*/
@@ -75,6 +75,7 @@
* @static
*/
protected static $filteredFiles = array(
+ 'Image/GraphViz.php',
'Log/composite.php',
'Log/console.php',
'Log/daemon.php',
@@ -209,15 +210,6 @@
*/
protected static function getCanonicalFilename($filename)
{
- foreach (array('PHPUnit2', 'PEAR') as $package) {
- $pos = strpos($filename, $package);
-
- if ($pos !== FALSE) {
- $filename = substr($filename, $pos);
- break;
- }
- }
-
return str_replace(
'\\',
'/',
@@ -234,11 +226,18 @@
*/
protected static function isFiltered($filename)
{
- if (substr($filename, -7) == 'phpunit' ||
- in_array(self::getCanonicalFilename($filename), self::$filteredFiles)) {
+ $filename = self::getCanonicalFilename($filename);
+
+ if (in_array($filename, self::$filteredFiles)) {
return TRUE;
}
+ foreach (self::$filteredFiles as $filteredFile) {
+ if (strpos($filename, $filteredFile) !== FALSE) {
+ return TRUE;
+ }
+ }
+
return FALSE;
}
}