test.php 703 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace mindplay\test;
  3. use Composer\Autoload\ClassLoader;
  4. use mindplay\test\lib\xTestRunner;
  5. define('FULL_PATH', realpath(__DIR__ . '/..'));
  6. $vendor_path = FULL_PATH . '/vendor';
  7. if (!is_dir($vendor_path)) {
  8. echo 'Install dependencies first' . PHP_EOL;
  9. exit(1);
  10. }
  11. require_once($vendor_path . '/autoload.php');
  12. $auto_loader = new ClassLoader();
  13. $auto_loader->addPsr4("mindplay\\test\\", FULL_PATH . '/test');
  14. $auto_loader->addPsr4("mindplay\\test\\Sample\\", FULL_PATH . '/test/suite/Sample');
  15. $auto_loader->register();
  16. $runner = new xTestRunner(dirname(__DIR__) . '/src/annotations', xTestRunner::createResultPrinter());
  17. exit($runner->run(__DIR__.'/suite', '.test.php') ? 0 : 1);