54 lines
1.9 KiB
PHP
54 lines
1.9 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
/**
|
|
* The zen file of testcase module of ZenTaoPMS.
|
|
*
|
|
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
|
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
|
* @author Mengyi Liu <liumengyi@easycorp.ltd>
|
|
* @package testcase
|
|
* @link https://www.zentao.net
|
|
*/
|
|
class testcaseZen extends testcase
|
|
{
|
|
/**
|
|
* Assign testcase related variables.
|
|
*
|
|
* @param object $case
|
|
* @param string $from
|
|
* @param int $taskID
|
|
* @access protected
|
|
* @return void
|
|
*/
|
|
protected function assignCaseForView(object $case, string $from, int $taskID)
|
|
{
|
|
$case = $this->loadModel('story')->checkNeedConfirm($case);
|
|
if($from == 'testtask')
|
|
{
|
|
$run = $this->loadModel('testtask')->getRunByCase($taskID, $case->id);
|
|
$case->assignedTo = $run->assignedTo;
|
|
$case->lastRunner = $run->lastRunner;
|
|
$case->lastRunDate = $run->lastRunDate;
|
|
$case->lastRunResult = $run->lastRunResult;
|
|
$case->caseStatus = $case->status;
|
|
$case->status = $run->status;
|
|
|
|
$results = $this->testtask->getResults($run->id);
|
|
$result = array_shift($results);
|
|
if($result)
|
|
{
|
|
$case->xml = $result->xml;
|
|
$case->duration = $result->duration;
|
|
}
|
|
}
|
|
$case = $this->testcase->appendCaseFails($case, $from, $taskID);
|
|
|
|
$this->view->runID = $from == 'testcase' ? 0 : $run->id;
|
|
$this->view->case = $case;
|
|
$this->view->caseFails = $case->caseFails;
|
|
$this->view->modulePath = $this->tree->getParents($case->module);
|
|
$this->view->caseModule = empty($case->module) ? '' : $this->tree->getById($case->module);
|
|
}
|
|
}
|
|
|