Location: PHPKode > scripts > PHPStopFlood > phpstopflood/_tests/testsSuite.php
<?php

require_once 'PHPUnit/Framework/TestSuite.php';

/**
 * Static test suite.
 */
class testsSuite extends PHPUnit_Framework_TestSuite {

	/**
	 * Constructs the test suite handler.
	 */
	public function __construct() {
		$this->setName('PHPStopFloodTests');
		$this->addTestFiles(new DirectoryFilterTests(dirname(__FILE__)));
	}

	/**
	 * Creates the suite.
	 */
	public static function suite() {
		return new self();
	}
}

class DirectoryFilterTests extends FilterIterator
{
    public function __construct($path)
    {
        parent::__construct(new DirectoryIterator($path));
    }

    public function accept()
    {
    	$ext = pathinfo($this->getInnerIterator()->getFilename());
    	if($ext['basename']==basename(__FILE__)) {
    		return false;
    	}
        return (in_array($ext['extension'], array('php', 'php5')));
    }
}
?>

Return current item: PHPStopFlood