Adding support for module shared model. If a module admin exists and there is a file...
[akelos.git] / test / app.php
blob896ec36624d785248f2e24a2289ba9237f486028
1 <?php
3 set_time_limit(0);
5 define('ALL_TESTS_CALL',true);
6 define('ALL_TESTS_RUNNER',true);
8 defined('AK_TEST_DATABASE_ON') ? null : define('AK_TEST_DATABASE_ON', true);
10 require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
12 require_once(AK_LIB_DIR.DS.'AkInstaller.php');
14 session_start();
16 $test = &new GroupTest('Unit tests for my Akelos application');
18 function load_tests($dir, &$test)
20 $d = dir($dir);
21 while (false !== ($entry = $d->read())) {
22 if($entry != '.' && $entry != '..' && $entry[0] != '.' && $entry[0] != '_') {
23 $entry = $dir.DS.$entry;
24 if(is_dir($entry)) {
25 load_tests($entry, $test);
26 } else {
27 if(!strstr(file_get_contents($entry), 'ALL_TESTS_RUNNER')){
28 $test->addTestFile($entry);
29 }else{
30 require_once($entry);
35 $d->close();
38 load_tests(AK_TEST_DIR.DS.'unit'.DS.'app', $test);
40 if (TextReporter::inCli()) {
41 exit ($test->run(new TextReporter()) ? 0 : 1);
43 $test->run(new HtmlReporter());