Source for file IncludePathTestCollector.php
Documentation is available at IncludePathTestCollector.php
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | Copyright (c) 2002-2005 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: IncludePathTestCollector.php,v 1.8.2.1 2004/12/22 08:06:07 sebastian Exp $
class AppendIterator implements Iterator {
public function __construct () {
$this->iterators = new ArrayIterator ();
public function __call ($func, $params) {
public function append (Iterator $it) {
$this->iterators->append ($it);
public function getInnerIterator () {
return $this->iterators->current ();
public function rewind () {
$this->iterators->rewind ();
if ($this->iterators->valid ()) {
$this->getInnerIterator ()->rewind ();
public function valid () {
return $this->iterators->valid () && $this->getInnerIterator ()->valid ();
public function current () {
return $this->iterators->valid () ? $this->getInnerIterator ()->current () : NULL;
return $this->iterators->valid () ? $this->getInnerIterator ()->key () : NULL;
if (!$this->iterators->valid ()) return;
$this->getInnerIterator ()->next ();
if ($this->getInnerIterator ()->valid ()) return;
$this->iterators->next ();
while ($this->iterators->valid ()) {
$this->getInnerIterator ()->rewind ();
if ($this->getInnerIterator ()->valid ()) return;
$this->iterators->next ();
require_once 'PHPUnit2/Runner/TestCollector.php';
* An implementation of a TestCollector that consults the
* include path set in the php.ini.
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright Copyright © 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
// {{{ public function collectTests()
$iterator = new AppendIterator;
if (substr(PHP_OS , 0 , 3 ) == 'WIN') {
foreach ($paths as $path) {
new RecursiveIteratorIterator (
new RecursiveDirectoryIterator ($path)
foreach ($iterator as $path => $file) {
if (substr(PHP_OS , 0 , 3 ) == 'WIN') {
// {{{ protected function isTestClass($classFileName)
* 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;
* vim600: et sw=2 ts=2 fdm=marker
Documentation generated on Mon, 11 Mar 2019 14:19:18 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|