Source for file Filter.php
Documentation is available at Filter.php
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | Copyright (c) 2002-2004 Sebastian Bergmann <sb@sebastian-bergmann.de>. |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License, |
// | that is available at http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
// $Id: Filter.php,v 1.6.2.2 2004/08/24 07:59:53 sebastian Exp $
* Utility class for code filtering.
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright Copyright © 2002-2004 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
* Source files that are to be filtered.
protected static $filteredFiles = array (
'PHPUnit2/Extensions/ExceptionTestCase.php',
'PHPUnit2/Extensions/RepeatedTest.php',
'PHPUnit2/Extensions/TestDecorator.php',
'PHPUnit2/Extensions/TestSetup.php',
'PHPUnit2/Framework/Assert.php',
'PHPUnit2/Framework/AssertionFailedError.php',
'PHPUnit2/Framework/ComparisonFailure.php',
'PHPUnit2/Framework/IncompleteTest.php',
'PHPUnit2/Framework/IncompleteTestError.php',
'PHPUnit2/Framework/Test.php',
'PHPUnit2/Framework/TestCase.php',
'PHPUnit2/Framework/TestFailure.php',
'PHPUnit2/Framework/TestListener.php',
'PHPUnit2/Framework/TestResult.php',
'PHPUnit2/Framework/TestSuite.php',
'PHPUnit2/Framework/Warning.php',
'PHPUnit2/Runner/BaseTestRunner.php',
'PHPUnit2/Runner/StandardTestSuiteLoader.php',
'PHPUnit2/Runner/TestCollector.php',
'PHPUnit2/Runner/TestRunListener.php',
'PHPUnit2/Runner/TestSuiteLoader.php',
'PHPUnit2/Runner/Version.php',
'PHPUnit2/TextUI/ResultPrinter.php',
'PHPUnit2/TextUI/TestRunner.php',
'PHPUnit2/Util/Filter.php',
'PHPUnit2/Util/Printer.php'
// {{{ public static function getFilteredStacktrace(Exception $e)
* Filters stack frames from PHPUnit classes.
$filteredStacktrace = '';
$stacktrace = $e->getTrace ();
foreach ($stacktrace as $frame) {
if (isset ($frame['file']) &&
!in_array(self ::getCanonicalFilename ($frame['file']), self ::$filteredFiles)) {
$filteredStacktrace .= sprintf (
isset ($frame['line']) ? $frame['line'] : '?'
return $filteredStacktrace;
// {{{ protected static function getCanonicalFilename($filename)
* Canonicalizes a source file name.
* vim600: et sw=2 ts=2 fdm=marker
Documentation generated on Mon, 11 Mar 2019 13:55:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|