@@ -758,7 +758,7 @@ public function getSeleniumBrowserConfiguration()
758
758
* @return PHPUnit_Framework_TestSuite
759
759
* @since Method available since Release 3.2.1
760
760
*/
761
- public function getTestSuiteConfiguration ()
761
+ public function getTestSuiteConfiguration ($ testSuiteFilter = null )
762
762
{
763
763
$ testSuiteNodes = $ this ->xpath ->query ('testsuites/testsuite ' );
764
764
@@ -767,15 +767,15 @@ public function getTestSuiteConfiguration()
767
767
}
768
768
769
769
if ($ testSuiteNodes ->length == 1 ) {
770
- return $ this ->getTestSuite ($ testSuiteNodes ->item (0 ));
770
+ return $ this ->getTestSuite ($ testSuiteNodes ->item (0 ), $ testSuiteFilter );
771
771
}
772
772
773
773
if ($ testSuiteNodes ->length > 1 ) {
774
774
$ suite = new PHPUnit_Framework_TestSuite ;
775
775
776
776
foreach ($ testSuiteNodes as $ testSuiteNode ) {
777
777
$ suite ->addTestSuite (
778
- $ this ->getTestSuite ($ testSuiteNode )
778
+ $ this ->getTestSuite ($ testSuiteNode, $ testSuiteFilter )
779
779
);
780
780
}
781
781
@@ -788,7 +788,7 @@ public function getTestSuiteConfiguration()
788
788
* @return PHPUnit_Framework_TestSuite
789
789
* @since Method available since Release 3.4.0
790
790
*/
791
- protected function getTestSuite (DOMElement $ testSuiteNode )
791
+ protected function getTestSuite (DOMElement $ testSuiteNode, $ testSuiteFilter = null )
792
792
{
793
793
if ($ testSuiteNode ->hasAttribute ('name ' )) {
794
794
$ suite = new PHPUnit_Framework_TestSuite (
@@ -807,6 +807,10 @@ protected function getTestSuite(DOMElement $testSuiteNode)
807
807
$ fileIteratorFacade = new File_Iterator_Facade ;
808
808
809
809
foreach ($ testSuiteNode ->getElementsByTagName ('directory ' ) as $ directoryNode ) {
810
+ if ($ testSuiteFilter && $ directoryNode ->parentNode ->getAttribute ('name ' ) != $ testSuiteFilter ) {
811
+ continue ;
812
+ }
813
+
810
814
$ directory = (string )$ directoryNode ->nodeValue ;
811
815
812
816
if (empty ($ directory )) {
@@ -851,6 +855,10 @@ protected function getTestSuite(DOMElement $testSuiteNode)
851
855
}
852
856
853
857
foreach ($ testSuiteNode ->getElementsByTagName ('file ' ) as $ fileNode ) {
858
+ if ($ testSuiteFilter && $ fileNode ->parentNode ->getAttribute ('name ' ) != $ testSuiteFilter ) {
859
+ continue ;
860
+ }
861
+
854
862
$ file = (string )$ fileNode ->nodeValue ;
855
863
856
864
if (empty ($ file )) {
0 commit comments