Permalink
Browse files

- Merge [3564].

  • Loading branch information...
1 parent bed3a16 commit 903eb4a34ba08a921e232a5d8564921273cd5bac @sebastianbergmann committed Aug 17, 2008
Showing with 29 additions and 9 deletions.
  1. +29 −9 PHPUnit/Extensions/SeleniumTestCase.php
@@ -142,13 +142,9 @@ public static function suite($className)
// Create tests from Selenese/HTML files.
if (isset($staticProperties['seleneseDirectory']) &&
is_dir($staticProperties['seleneseDirectory'])) {
- $files = new PHPUnit_Util_FilterIterator(
- new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator(
- $staticProperties['seleneseDirectory']
- )
- ),
- '.htm'
+ $files = array_merge(
+ self::getSeleneseFiles($staticProperties['seleneseDirectory'], '.htm'),
+ self::getSeleneseFiles($staticProperties['seleneseDirectory'], '.html')
);
// Create tests from Selenese/HTML files for multiple browsers.
@@ -159,7 +155,7 @@ public static function suite($className)
foreach ($files as $file) {
$browserSuite->addTest(
- new $className((string)$file, array(), $browser),
+ new $className($file, array(), $browser),
$classGroups
);
}
@@ -171,7 +167,7 @@ public static function suite($className)
// Create tests from Selenese/HTML files for single browser.
else {
foreach ($files as $file) {
- $suite->addTest(new $className((string)$file), $classGroups);
+ $suite->addTest(new $className($file), $classGroups);
}
}
}
@@ -1203,6 +1199,30 @@ protected function explodeDirectories($path)
}
/**
+ * @param string $directory
+ * @param string $suffix
+ * @return array
+ * @since Method available since Release 3.3.0
+ */
+ protected static function getSeleneseFiles($directory, $suffix)
+ {
+ $files = array();
+
+ $iterator = new PHPUnit_Util_FilterIterator(
+ new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator($directory)
+ ),
+ $suffix
+ );
+
+ foreach ($iterator as $file) {
+ $files[] = (string)$file;
+ }
+
+ return $files;
+ }
+
+ /**
* @param string $action
* @since Method available since Release 3.2.0
*/

0 comments on commit 903eb4a

Please sign in to comment.