Ejemplo n.º 1
0
 public function loadTests($path = null)
 {
     $testLoader = new TestLoader($this->settings['path']);
     $path ? $testLoader->loadTest($path) : $testLoader->loadTests();
     $tests = $testLoader->getTests();
     if ($this->settings['shuffle']) {
         shuffle($tests);
     }
     foreach ($tests as $test) {
         $this->addToSuite($test);
     }
 }
Ejemplo n.º 2
0
 /**
  * @group core
  */
 public function testLoadAllTests()
 {
     Codeception\Util\Autoload::addNamespace('Math', codecept_data_dir() . 'claypit/tests/_support/Math');
     // to autoload dependencies
     $this->testLoader = new \Codeception\Lib\TestLoader(codecept_data_dir() . 'claypit/tests');
     $this->testLoader->loadTests();
     $testNames = $this->getTestNames($this->testLoader->getTests());
     $this->assertContainsTestName('order/AnotherCept', $testNames);
     $this->assertContainsTestName('MageGuildCest::darkPower', $testNames);
     $this->assertContainsTestName('FailingTest::testMe', $testNames);
     $this->assertContainsTestName('MathCest::testAddition', $testNames);
     $this->assertContainsTestName('MathTest::testAll', $testNames);
 }