main_api.lib.test_standalone.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * A simple set of tests for the main API.
  5. * @author Ivan Tcholakov, 2009.
  6. * @package chamilo.tests
  7. */
  8. /**
  9. * Init
  10. */
  11. $_current_dir = dirname(__FILE__).'/';
  12. $_sys_code_path = $_current_dir.'../main/';
  13. $_sys_include_path = $_sys_code_path.'inc/';
  14. $_sys_library_path = $_sys_code_path.'inc/lib/';
  15. $_test_sys_code_path = $_current_dir.'main/';
  16. $_test_sys_include_path = $_test_sys_code_path.'inc/';
  17. $_test_sys_library_path = $_test_sys_code_path.'inc/lib/';
  18. require_once($_current_dir.'simpletest/unit_tester.php');
  19. require_once($_sys_include_path.'global.inc.php');
  20. //header('Content-Type: text/html; charset=' . api_get_system_encoding());
  21. header('Content-Type: text/html; charset=' . 'UTF-8');
  22. require_once($_current_dir.'simpletest/web_tester.php');
  23. require_once($_current_dir.'simpletest/mock_objects.php');
  24. require_once($_current_dir.'simpletest/autorun.php');
  25. $_SESSION['_user']['user_id'] = 1;
  26. class MainApiTests extends TestSuite {
  27. function MainApiTests() {
  28. $this->TestSuite('Main API Tests');
  29. global $_test_sys_library_path;
  30. $this->addTestFile($_test_sys_library_path.'main_api.lib.test_standalone.php');
  31. }
  32. }
  33. $test = & new MainApiTests();
  34. //$test-> run( new HtmlReporter());