3 * This file is part of PHPUnit.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
12 * Suite for .phpt test cases.
14 * @since Class available since Release 3.1.4
16 class PHPUnit_Extensions_PhptTestSuite extends PHPUnit_Framework_TestSuite
19 * Constructs a new TestSuite for .phpt test cases.
21 * @param string $directory
23 * @throws PHPUnit_Framework_Exception
25 public function __construct($directory)
27 if (is_string($directory) && is_dir($directory)) {
28 $this->setName($directory);
30 $facade = new File_Iterator_Facade;
31 $files = $facade->getFilesAsArray($directory, '.phpt');
33 foreach ($files as $file) {
34 $this->addTestFile($file);
37 throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'directory name');