예제 #1
0
	public function deletePost($request, $response)
	{/*{{{*/
		$program = DAL::get()->find('program', $request->programid);
		
		$params = array();
		$params['preMsg'] = "项目[{$program->name}]成功删除";
		if($program->getModuleCnt() < 1)
		{
			UsecaseClient::getInstance()->deleteProgram($request->programid);
		}else {
			$params['preMsg'] = "项目[{$program->name}]删除失败,存在".$program->getModuleCnt()."个子模块";
		}
		$response->setRedirect($response->router->urlfor('program/alllist',$params));
	}/*}}}*/
예제 #2
0
    public function cppost($request, $response)
    {/*{{{*/
        $usecase =  DAL::get()->find('usecase', $request->usecaseid);
        $funPointId = $request->funpointid;
        if(0 == $request->programid || 0 == $request->moduleid || 0 == $request->funpointid )
        {
            $preMsg = "复制失败,请选择要复制用例的路径!";
            $response->setRedirect($response->router->urlfor('usecase/one', array('usecaseid'=>$usecase->id, 'preMsg'=>$preMsg)));
            return;
        }
        if ( $funPointId == $usecase->funpointid)
        {
            $preMsg = "复制失败,当前功能下已经有相同的用例,请核对用例的路径!";
            $response->setRedirect($response->router->urlfor('usecase/one', array('usecaseid'=>$usecase->id, 'preMsg'=>$preMsg)));
            return;
        }
        $operator = $this->tester;
        $params = array();
        $params['autofuns'] = $usecase->autofuns;
        $params['attachmentIds'] = $usecase->attachmentIds;
        $params['relateusecaseids'] = $usecase->relateusecaseids;
        $bugs = DAL::get()->find('bug', $usecase->bugIds);
        $bugNames = array();
        foreach($bugs as $bug)
        {
            if ($bug instanceof Bug)
            {
                $bugNames[] = $bug->name; 
            }
        }
        $params['bugnames'] = $bugNames;
        $newUsecaseId = UsecaseClient::getInstance()->addUsecase($funPointId, $request->title, $usecase->step, $usecase->expectresult, $usecase->auto, $usecase->smoke, $usecase->priority, $operator, $params);
		$preMsg = "复制用例成功,原用例ID=".$usecase->id ;
		$response->setRedirect($response->router->urlfor('usecase/modify', array('usecaseid'=>$newUsecaseId, 'preMsg'=>$preMsg)));
    }/*}}}*/
	public function delFunpoint($request, $response)
	{/*{{{*/
		UsecaseClient::getInstance()->deleteFunpoint($request->funpointid);
	}/*}}}*/
	public function modifyPost($request, $response)
	{
		$taskItemId = $request->taskItemId;
		$taskItem = TaskItem::getById($taskItemId);
		DBC::requireTrue($taskItem instanceof TaskItem,"任务项 {$taskItemId} 不存在");
		
		UsecaseClient::getInstance()->modifyTaskItem($taskItem->id,$request->result,$request->bugInfo);
		
		$taskItem =  DAL::get()->find('taskitem', $taskItemId,true);
		
		$preMsg = "{$taskItem->usecase->id} 执行结果:{$taskItem->resultDesc}";
		$response->setRedirect($response->router->urlfor('taskitem/next',array('preTaskItemId'=>$taskItem->id,'preMsg'=>$preMsg)));
	}
	public function ctrlTestTask($request, $response)
	{/*{{{*/
		UsecaseClient::getInstance()->ctrlTestTask($request->testtaskid, $request->status,$this->tester->id);
		$response->setRedirect('/testtask/detail?testtaskid='.$request->testtaskid);
	}/*}}}*/
예제 #6
0
	public function updateModulePriority($request,$response)
	{/*{{{*/
		$callBack = $_SERVER['HTTP_REFERER'];
		UsecaseClient::getInstance()->updateModulePriority($request->priorities);
		$response->setRedirect($callBack);
	}/*}}}*/