Source for file IncludePathTestCollector.php
Documentation is available at IncludePathTestCollector.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* 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 web, please
* send a note to license@php.net so we can mail you a copy immediately.
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: IncludePathTestCollector.php,v 1.13.2.3 2005/10/12 17:07:07 sebastian Exp $
* @link http://pear.php.net/package/PHPUnit2
* @since File available since Release 2.1.0
$this->iterators = new ArrayIterator ();
public function __call($func, $params) {
public function append(Iterator $it) {
$this->iterators->append ($it);
return $this->iterators->current ();
$this->iterators->rewind ();
if ($this->iterators->valid ()) {
public function valid() {
if (!$this->iterators->valid ()) return;
$this->iterators->next ();
while ($this->iterators->valid ()) {
$this->iterators->next ();
require_once 'PHPUnit2/Runner/TestCollector.php';
require_once 'PEAR/Config.php';
* An implementation of a TestCollector that consults the
* include path set in the php.ini.
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: @package_version@
* @link http://pear.php.net/package/PHPUnit2
* @since Class available since Release 2.1.0
$config = new PEAR_Config;
if (substr(PHP_OS , 0 , 3 ) == 'WIN') {
$paths[] = $config->get ('test_dir');
foreach ($paths as $path) {
new RecursiveIteratorIterator (
new RecursiveDirectoryIterator ($path)
foreach ($iterator as $path => $file) {
if (substr(PHP_OS , 0 , 3 ) == 'WIN') {
* Considers a file to contain a test class when it contains the
* pattern "Test" in its name and its name ends with ".php".
* @param string $classFileName
return (strpos($classFileName, 'Test') !== FALSE && substr($classFileName, -4 ) == '.php') ? TRUE : FALSE;
* c-hanging-comment-ender-p: nil
Documentation generated on Mon, 11 Mar 2019 14:12:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|