testresult.php 5.0 KB

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