Example #1
0
 /**
  * @constructor
  * @param string $theClass
  * @param string $name
  */
 public function __construct($theClass = '', $name = '')
 {
     $this->initObjectManager();
     $this->testSuiteFactory = $this->objectManager->get('Mtf\\TestSuite\\TestSuiteFactory');
     /** @var $testIterator \Mtf\Util\Iterator\TestCase */
     $testIterator = $this->objectManager->create('Mtf\\Util\\Iterator\\TestCase');
     while ($testIterator->valid()) {
         $arguments = $testIterator->current();
         $class = $arguments['class'];
         $factory = $this->testSuiteFactory;
         $testCallback = $this->objectManager->create('Mtf\\TestSuite\\Callback', ['factory' => $factory, 'arguments' => $arguments, 'theClass' => $class]);
         $rule = $this->objectManager->get('Mtf\\TestRunner\\Rule\\SuiteComposite');
         $testCaseSuite = $this->testSuiteFactory->get($class);
         $allow = $rule->filterSuite($testCaseSuite);
         if ($allow) {
             $this->addTest($testCallback, \PHPUnit_Util_Test::getGroups($class));
         }
         $testIterator->next();
     }
     parent::__construct($name);
 }