public function scan($rootPath)
 {
     $rootPath = realpath(APP_ROOT . DIRECTORY_SEPARATOR . $rootPath);
     $scanner = new RecursiveFileScanner();
     $scanner->prepare(RecursiveFileFilter::createExtNameFilter("php"));
     $types = TypeScanner::scan($scanner->scan($rootPath), array('\\classes\\stereotype\\Component'));
     return $types;
 }
 public function testFileScanner()
 {
     $scanner = new RecursiveFileScanner();
     $scanner->prepare(RecursiveFileFilter::createExtNameFilter("php"));
     $results = $scanner->scan(APP_ROOT . "/app/classes");
     $this->assertTrue(is_array($results), "not valid");
     $this->assertNotEquals(0, count($results), "no results");
     //var_dump("filescanner",$results);
 }
Exemple #3
0
 /**
  *
  * @return PerminatorPHPUnitSuite
  */
 public static function suite()
 {
     $suite = new self();
     $suite->setName(__CLASS__);
     $rootPath = realpath(APP_ROOT . 'test');
     $scanner = new RecursiveFileScanner();
     $scanner->prepare(RecursiveFileFilter::createExtNameFilter("php"));
     $types = TypeScanner::scan($scanner->scan($rootPath), array('\\PHPUnit_Framework_TestCase'), array(), array());
     foreach ($types as $type) {
         $suite->addTestSuite($type);
     }
     return $suite;
 }