testrun.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. $this->app->loadLang('testcase');
  3. $this->app->loadLang('testtask');
  4. $this->app->loadLang('tree');
  5. $this->app->loadLang('project');
  6. $this->app->loadLang('execution');
  7. $this->app->loadLang('build');
  8. $this->app->loadLang('product');
  9. $this->app->loadLang('dataview');
  10. $schema = new stdclass();
  11. $schema->primaryTable = 'testrun';
  12. $schema->tables = array();
  13. $schema->tables['testrun'] = 'zt_testrun';
  14. $schema->tables['testcase'] = 'zt_case';
  15. $schema->tables['testtask'] = 'zt_testtask';
  16. $schema->tables['casemodule'] = 'zt_module';
  17. $schema->tables['project'] = 'zt_project';
  18. $schema->tables['execution'] = 'zt_project';
  19. $schema->tables['build'] = 'zt_build';
  20. $schema->tables['product'] = 'zt_product';
  21. $schema->joins = array();
  22. $schema->joins['testcase'] = '`testcase`.`id` = `testrun`.`case`';
  23. $schema->joins['product'] = '`product`.`id` = `testcase`.`product`';
  24. $schema->joins['testtask'] = '`testtask`.`id` = `testrun`.`task`';
  25. $schema->joins['casemodule'] = '`casemodule`.`id` = `testcase`.`module`';
  26. $schema->joins['project'] = '`project`.`id` = CAST(`testtask`.`project` AS DECIMAL)';
  27. $schema->joins['execution'] = '`execution`.`id` = `testtask`.`execution`';
  28. $schema->joins['build'] = '`build`.`id` = CAST(`testtask`.`build` AS DECIMAL)';
  29. $schema->fields = array();
  30. $schema->fields['testtask'] = array('type' => 'object', 'name' => $this->lang->testtask->common, 'object' => 'testtask', 'show' => 'testtask.name');
  31. $schema->fields['testcase'] = array('type' => 'object', 'name' => $this->lang->testcase->common, 'object' => 'testcase', 'show' => 'testcase.title');
  32. $schema->fields['assignedTo'] = array('type' => 'user', 'name' => $this->lang->testcase->assignedTo);
  33. $schema->fields['project'] = array('type' => 'object', 'name' => $this->lang->project->common, 'object' => 'project', 'show' => 'project.name');
  34. $schema->fields['build'] = array('type' => 'object', 'name' => $this->lang->build->common, 'object' => 'build', 'show' => 'build.name');
  35. $schema->fields['execution'] = array('type' => 'object', 'name' => $this->lang->execution->common, 'object' => 'execution', 'show' => 'execution.name');
  36. $schema->fields['casemodule'] = array('type' => 'object', 'name' => $this->lang->tree->common, 'object' => 'casemodule', 'show' => 'casemodule.name');
  37. $schema->fields['lastRunner'] = array('type' => 'user', 'name' => $this->lang->testtask->lastRunner);
  38. $schema->fields['lastRunDate'] = array('type' => 'user', 'name' => $this->lang->testtask->lastRunDate);
  39. $schema->fields['lastRunResult'] = array('type' => 'option', 'name' => $this->lang->testtask->lastRunResult, 'options' => $this->lang->testcase->resultList);
  40. $schema->objects = array();
  41. $schema->objects['testcase'] = array();
  42. $schema->objects['testcase']['id'] = array('type' => 'number', 'name' => $this->lang->testcase->id);
  43. $schema->objects['testcase']['title'] = array('type' => 'string', 'name' => $this->lang->testcase->title);
  44. $schema->objects['testtask'] = array();
  45. $schema->objects['testtask']['id'] = array('type' => 'number', 'name' => $this->lang->testtask->id);
  46. $schema->objects['testtask']['name'] = array('type' => 'string', 'name' => $this->lang->testtask->name);
  47. $schema->objects['testcase'] = array();
  48. $schema->objects['testcase']['id'] = array('type' => 'number', 'name' => $this->lang->testcase->id);
  49. $schema->objects['testcase']['title'] = array('type' => 'string', 'name' => $this->lang->testcase->title);
  50. $schema->objects['build'] = array();
  51. $schema->objects['build']['id'] = array('type' => 'number', 'name' => $this->lang->dataview->id);
  52. $schema->objects['build']['name'] = array('type' => 'string', 'name' => $this->lang->build->name);
  53. $schema->objects['project'] = array();
  54. $schema->objects['project']['id'] = array('type' => 'number', 'name' => $this->lang->project->id);
  55. $schema->objects['project']['name'] = array('type' => 'string', 'name' => $this->lang->project->name);
  56. $schema->objects['execution'] = array();
  57. $schema->objects['execution']['id'] = array('type' => 'number', 'name' => $this->lang->execution->id);
  58. $schema->objects['execution']['name'] = array('type' => 'string', 'name' => $this->lang->execution->name);
  59. $schema->objects['casemodule'] = array();
  60. $schema->objects['casemodule']['id'] = array('type' => 'number', 'name' => $this->lang->dataview->id);
  61. $schema->objects['casemodule']['name'] = array('type' => 'string', 'name' => $this->lang->dataview->name);
  62. $schema->objects['product'] = array();
  63. $schema->objects['product']['id'] = array('type' => 'number', 'name' => $this->lang->product->id);
  64. $schema->objects['product']['name'] = array('type' => 'string', 'name' => $this->lang->product->name);