diff --git a/module/holiday/model.php b/module/holiday/model.php index f106024f6f..e1eb0503a3 100644 --- a/module/holiday/model.php +++ b/module/holiday/model.php @@ -174,13 +174,16 @@ class holidayModel extends model ->andWhere('end')->ge($begin) ->fetchAll('id'); + $naturalDays = $this->getDaysBetween($begin, $end); + $workingDays = array(); foreach($records as $record) { - $dates = $this->getDaysBetween($record->begin, $record->end); + $dates = $this->getDaysBetween($record->begin, $record->end); $workingDays = array_merge($workingDays, $dates); } - return $workingDays; + + return array_intersect($naturalDays, $workingDays); } /** diff --git a/module/job/model.php b/module/job/model.php index f88120da2a..751924af9e 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -486,7 +486,7 @@ class jobModel extends model } /** - * Exec jenkins pipeline. + * Exec jenkins pipeline. * * @param object $job * @param object $repo diff --git a/module/setting/model.php b/module/setting/model.php index 72e55e0482..064c6f4aa2 100644 --- a/module/setting/model.php +++ b/module/setting/model.php @@ -77,8 +77,7 @@ class settingModel extends model $item->section = $section; $item->key = $key; $item->value = $value; - - if($vision) $item->vision = $vision; + $item->vision = empty($vision) ? '' : $vision; $this->dao->replace(TABLE_CONFIG)->data($item)->exec(); } @@ -164,6 +163,12 @@ class settingModel extends model */ public function createDAO($params, $method = 'select') { + $params['vision'] = isset($params['vision']) ? $params['vision'] : ''; + $params['owner'] = isset($params['owner']) ? $params['owner'] : ''; + $params['module'] = isset($params['module']) ? $params['module'] : ''; + $params['section'] = isset($params['section']) ? $params['section'] : ''; + $params['key'] = isset($params['key']) ? $params['key'] : ''; + return $this->dao->$method('*')->from(TABLE_CONFIG)->where('1 = 1') ->beginIF($params['vision'])->andWhere('vision')->in($params['vision'])->fi() ->beginIF($params['owner'])->andWhere('owner')->in($params['owner'])->fi() diff --git a/module/weekly/model.php b/module/weekly/model.php index 14c4cc7287..a2d7d5c460 100755 --- a/module/weekly/model.php +++ b/module/weekly/model.php @@ -343,7 +343,7 @@ class weeklyModel extends model $monday = $this->getThisMonday($date); $nextMonday = date('Y-m-d', strtotime("$monday +7 days")); - $executions = $this->loadModel('execution')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $project); + $executions = $this->loadModel('execution')->getList($project); $executionIdList = array_keys($executions); return $this->dao->select('*') diff --git a/test/class/ci.class.php b/test/class/ci.class.php new file mode 100644 index 0000000000..7d00aceb4b --- /dev/null +++ b/test/class/ci.class.php @@ -0,0 +1,57 @@ +objectModel = $tester->loadModel('ci'); + } + + /** + * Set menu. + * + * @access public + * @return array + */ + public function setMenuTest() + { + $_SESSION['repoID'] = 1; + $this->objectModel->setMenu(); + + global $lang; + return $lang->devops->menu->code; + } + + /** + * Sync compile status. + * + * @param int $jobID + * @access public + * @return string + */ + public function syncCompileStatusTest($jobID) + { + global $tester; + $tester->loadModel('job')->exec($jobID); + $compileID = $tester->dao->select('id')->from(TABLE_COMPILE)->orderBy('id_desc')->fetch('id'); + + $notCompileMR = $tester->dao->select('id,jobID') + ->from(TABLE_MR) + ->where('jobID')->gt(0) + ->andWhere('compileStatus')->eq('created') + ->fetchPairs(); + + $compile = $tester->dao->select('compile.*, job.engine,job.pipeline, pipeline.name as jenkinsName,job.server,pipeline.url,pipeline.account,pipeline.token,pipeline.password') + ->from(TABLE_COMPILE)->alias('compile') + ->leftJoin(TABLE_JOB)->alias('job')->on('compile.job=job.id') + ->leftJoin(TABLE_PIPELINE)->alias('pipeline')->on('job.server=pipeline.id') + ->where('compile.id')->eq($compileID) + ->fetch(); + + $this->objectModel->syncCompileStatus($compile, $notCompileMR); + $compile = $tester->loadModel('compile')->getByID($compileID); + + if(dao::isError()) return dao::getError(); + return $compile; + } +} diff --git a/test/class/doc.class.php b/test/class/doc.class.php new file mode 100644 index 0000000000..143e7413aa --- /dev/null +++ b/test/class/doc.class.php @@ -0,0 +1,516 @@ +objectModel = $tester->loadModel('doc'); + } + + /** + * Function createLib test by doc + * + * @param array $param + * @access public + * @return object + */ + public function createLibTest($param) + { + $createFields = array('type' => '', 'name' => '', 'acl' => ''); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + $objectID = $this->objectModel->createLib(); + + unset($_POST); + + if(dao::isError()) return dao::getError(); + + $objects = $this->objectModel->getLibById($objectID); + + return $objects; + } + + /** + * Function createApiLib test by doc + * + * @param array $param + * @access public + * @return object + */ + public function createApiLibTest($param) + { + global $tester; + $tester->app->loadConfig('api'); + $tester->app->loadLang('doclib'); + + $createFields = array('name' => '', 'baseUrl' => '', 'acl' => '', 'desc' => '测试详情'); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + $objectID = $this->objectModel->createApiLib(); + + unset($_POST); + + if(dao::isError()) return dao::getError(); + + $objects = $this->objectModel->getLibById($objectID); + + return $objects; + } + + /** + * Function updateApiLib test by doc + * + * @param int $id + * @param array $param + * @access public + * @return void + */ + public function updateApiLibTest($id, $param) + { + global $tester; + $tester->app->loadConfig('api'); + $tester->app->loadLang('doclib'); + + $oldDoc = $this->objectModel->getLibById($id); + $data = new stdClass; + foreach($param as $key => $value) $data->$key = $value; + + $objects = $this->objectModel->updateApiLib($id, $oldDoc, $data); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Function updateLib test by doc + * + * @param int $libID + * @param array $param + * @access public + * @return array + */ + public function updateLibTest($libID, $param) + { + global $tester; + $tester->app->loadConfig('doc'); + + foreach($param as $key => $value) $_POST[$key] = $value; + $objects = $this->objectModel->updateLib($libID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Function getDocsByBrowseType test by doc + * + * @param string $browseType + * @param array $moduleID + * @param string $sort + * @param mixed $pager + * @access public + * @return array + */ + public function getDocsByBrowseTypeTest($browseType, $moduleID, $sort = 'id_desc', $pager = null) + { + global $tester; + $tester->app->loadConfig('doc'); + + $objects = $this->objectModel->getDocsByBrowseType($browseType, $queryID = '', $moduleID, $sort, $pager); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Function create test by doc + * + * @param array $param + * @access public + * @return array + */ + public function createTest($param) + { + global $tester; + $tester->app->loadConfig('api'); + $tester->app->loadLang('doclib'); + + $labels = array(); + $files = array(); + + $createFields = array('lib' => '', 'module' => '', 'title' => '', 'keywords' => '', 'type' => '', 'content' => '', 'contentMarkdown' => '', 'contentType' => '', + 'url' => '', 'labels' => $labels, 'files' => $files, 'contactListMenu' => '', 'acl' => ''); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + + $this->objectModel->create(); + + if(dao::isError()) return dao::getError(); + + $objects = $tester->dao->select('*')->from(TABLE_DOC)->where('title')->eq($_POST['title'])->andwhere('lib')->eq($_POST['lib'])->fetchAll(); + unset($_POST); + + return $objects; + } + + /** + * Function update test by doc + * + * @param int $docID + * @param array $param + * @access public + * @return array + */ + public function updateTest($docID, $param) + { + global $tester; + $tester->app->loadConfig('api'); + $tester->app->loadLang('doclib'); + + $labels = array(); + $files = array(); + + $createFields = array('lib' => '', 'module' => '', 'title' => '', 'keywords' => '', 'type' => '', 'content' => '', 'contentType' => '', + 'url' => '', 'labels' => $labels, 'files' => $files, 'contactListMenu' => '', 'acl' => ''); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + + $objects = $this->objectModel->update($docID); + + if(dao::isError()) return dao::getError(); + + return $objects["changes"]; + } + + /** + * Function saveDraft test by doc + * + * @param mixed $docID + * @param array $param + * @access public + * @return void + */ + public function saveDraftTest($docID, $param = array()) + { + global $tester; + $tester->app->loadConfig('doc'); + $tester->app->loadConfig('allowedTags'); + $createFields = array('content' => ''); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + + $this->objectModel->saveDraft($docID); + + if(dao::isError()) return dao::getError(); + + $objects = $tester->dao->select('id,draft')->from(TABLE_DOC)->where('id')->eq($docID)->fetchAll('id'); + unset($_POST); + + return $objects; + } + + public function extractKETableCSSTest($content) + { + $objects = $this->objectModel->extractKETableCSS($content); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function checkPrivLibTest($object, $extra = '') + { + $objects = $this->objectModel->checkPrivLib($object, $extra = ''); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function checkPrivDocTest($object) + { + $objects = $this->objectModel->checkPrivDoc($object); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getAllLibsByTypeTest($type, $pager = null, $product = '') + { + $objects = $this->objectModel->getAllLibsByType($type, $pager = null, $product = ''); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getAllLibGroupsTest($appendLibs = '') + { + $objects = $this->objectModel->getAllLibGroups($appendLibs = ''); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getLimitLibsTest($type, $limit = 0) + { + $objects = $this->objectModel->getLimitLibs($type, $limit = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getSubLibGroupsTest($type, $idList) + { + $objects = $this->objectModel->getSubLibGroups($type, $idList); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getLibsByObjectTest($type, $objectID, $mode = '', $appendLib = 0) + { + $objects = $this->objectModel->getLibsByObject($type, $objectID, $mode = '', $appendLib = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getOrderedObjectsTest($objectType = 'product') + { + $objects = $this->objectModel->getOrderedObjects($objectType = 'product'); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function statLibCountsTest($idList) + { + $objects = $this->objectModel->statLibCounts($idList); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getLibFilesTest($type, $objectID, $orderBy, $pager = null) + { + $objects = $this->objectModel->getLibFiles($type, $objectID, $orderBy, $pager = null); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getFileSourcePairsTest($files) + { + $objects = $this->objectModel->getFileSourcePairs($files); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getFileIconTest($files) + { + $objects = $this->objectModel->getFileIcon($files); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getDocTreeTest($libID) + { + $objects = $this->objectModel->getDocTree($libID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function fillDocsInTreeTest($node, $libID) + { + $objects = $this->objectModel->fillDocsInTree($node, $libID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getProductCrumbTest($productID, $executionID = 0) + { + $objects = $this->objectModel->getProductCrumb($productID, $executionID = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function setLibUsersTest($type, $objectID) + { + $objects = $this->objectModel->setLibUsers($type, $objectID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getLibIdListByProjectTest($projectID = 0) + { + $objects = $this->objectModel->getLibIdListByProject($projectID = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getStatisticInfoTest() + { + $objects = $this->objectModel->getStatisticInfo(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getPreAndNextDocTest($docID, $libID) + { + $objects = $this->objectModel->getPreAndNextDoc($docID, $libID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function printChildModuleTest($module, $libID, $methodName, $browseType, $moduleID) + { + $objects = $this->objectModel->printChildModule($module, $libID, $methodName, $browseType, $moduleID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function buildCrumbTitleTest($libID = 0, $param = 0, $title = '') + { + $objects = $this->objectModel->buildCrumbTitle($libID = 0, $param = 0, $title = ''); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function buildCreateButton4DocTest($objectType, $objectID, $libID) + { + $objects = $this->objectModel->buildCreateButton4Doc($objectType, $objectID, $libID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function buildCollectButton4DocTest() + { + $objects = $this->objectModel->buildCollectButton4Doc(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function buildBrowseSwitchTest($type, $objectID, $viewType) + { + $objects = $this->objectModel->buildBrowseSwitch($type, $objectID, $viewType); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function setFastMenuTest($fastLib) + { + $objects = $this->objectModel->setFastMenu($fastLib); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getToAndCcListTest($doc) + { + $objects = $this->objectModel->getToAndCcList($doc); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function selectTest($type, $objects, $objectID, $libs, $libID = 0) + { + $objects = $this->objectModel->select($type, $objects, $objectID, $libs, $libID = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getApiModuleTreeTest($rootID, $docID = 0, $release = 0) + { + $objects = $this->objectModel->getApiModuleTree($rootID, $docID = 0, $release = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getTreeMenuTest($type, $objectID, $rootID, $startModule = 0, $docID = 0) + { + $objects = $this->objectModel->getTreeMenu($type, $objectID, $rootID, $startModule = 0, $docID = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function summaryTest($files) + { + $objects = $this->objectModel->summary($files); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function setMenuByTypeTest($type, $objectID, $libID, $appendLib = 0) + { + $objects = $this->objectModel->setMenuByType($type, $objectID, $libID, $appendLib = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function checkAutoloadPageTest($doc) + { + $objects = $this->objectModel->checkAutoloadPage($doc); + + if(dao::isError()) return dao::getError(); + + return $objects; + } +} diff --git a/test/class/holiday.class.php b/test/class/holiday.class.php index d3c59768ae..a5ad1f7d40 100644 --- a/test/class/holiday.class.php +++ b/test/class/holiday.class.php @@ -34,11 +34,11 @@ class holidayTest */ public function getListTest($year = '', $type = 'all') { - $objects = $this->objectModel->getList($year = '', $type = 'all'); + $objects = $this->objectModel->getList($year, $type); if(dao::isError()) return dao::getError(); - return $objects; + return count($objects); } /** @@ -140,10 +140,10 @@ class holidayTest if(dao::isError()) return dao::getError(); - return $objects; + return count($objects); } - public function getWorkingDaysTest($begin, $end) + public function getWorkingDaysTest($begin = '', $end = '') { $objects = $this->objectModel->getWorkingDays($begin, $end); diff --git a/test/class/setting.class.php b/test/class/setting.class.php new file mode 100644 index 0000000000..7c6639ea28 --- /dev/null +++ b/test/class/setting.class.php @@ -0,0 +1,126 @@ +objectModel = $tester->loadModel('setting'); + } + + public function getItemTest($paramString) + { + $objects = $this->objectModel->getItem($paramString); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getItemsTest($paramString) + { + $objects = $this->objectModel->getItems($paramString); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function setItemTest($path, $value = '') + { + $objects = $this->objectModel->setItem($path, $value = ''); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function setItemsTest($path, $items) + { + $objects = $this->objectModel->setItems($path, $items); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function deleteItemsTest($paramString) + { + $objects = $this->objectModel->deleteItems($paramString); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function parseItemParamTest($paramString) + { + $objects = $this->objectModel->parseItemParam($paramString); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function createDAOTest($params, $method = 'select') + { + $objects = $this->objectModel->createDAO($params, $method = 'select'); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getSysAndPersonalConfigTest($account = '') + { + $objects = $this->objectModel->getSysAndPersonalConfig($account = ''); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getVersionTest() + { + $objects = $this->objectModel->getVersion(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getURSRTest() + { + $objects = $this->objectModel->getURSR(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function updateVersionTest($version) + { + $objects = $this->objectModel->updateVersion($version); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function setSNTest() + { + $objects = $this->objectModel->setSN(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function snNeededUpdateTest($sn) + { + $objects = $this->objectModel->snNeededUpdate($sn); + + if(dao::isError()) return dao::getError(); + + return $objects; + } +} diff --git a/test/class/weekly.class.php b/test/class/weekly.class.php index 38acef0d86..a183c45b6d 100644 --- a/test/class/weekly.class.php +++ b/test/class/weekly.class.php @@ -4,26 +4,91 @@ class weeklyTest public function __construct() { global $tester; - $this->objectModel = $tester->loadModel('weekly'); + $this->objectModel = $tester->loadModel('weekly'); + $this->projectModel = $tester->loadModel('project'); } - public function getPageNavTest($project, $date) + + /** + * GetPageNav + * + * @param int $projectID + * @param string $date + * @access public + * @return string + */ + + public function getPageNavTest($projectID, $date) { - $objects = $this->objectModel->getPageNav($project, $date); + $project = $this->projectModel->getById($projectID); + $pageNav = $this->objectModel->getPageNav($project, $date); + + if(dao::isError()) return dao::getError(); + + $start_str = mb_strpos($pageNav,"ass='btn'>") + mb_strlen("class='btn'>"); + $end_str = mb_strpos($pageNav,"") - $start_str; + $objects = mb_substr($pageNav,$start_str,$end_str); + return $objects; + } + + /** + * GetWeekPairs + * + * @param int $begin + * @param int $end + * @access public + * @return array + */ + + public function getWeekPairsTest($begin, $end) + { + switch($begin) + { + case '1': + $begin = date('Y-m-d'); + break; + case '2': + $begin = date('Y-m-d', strtotime(date('Y-m-d')."- 6 days")); + break; + case '3': + $begin = date('Y-m-d', strtotime(date('Y-m-d') . "+ 6 days")); + break; + case '': + $begin = ''; + break; + } + + switch($begin) + { + case '1': + $end = date('Y-m-d'); + break; + case '2': + $end = date('Y-m-d', strtotime(date('Y-m-d')."- 6 days")); + break; + case '3': + $end = date('Y-m-d', strtotime(date('Y-m-d') . "+ 6 days")); + break; + case '': + $end = ''; + break; + } + + $objects = $this->objectModel->getWeekPairs($begin, $end); if(dao::isError()) return dao::getError(); return $objects; } - public function getWeekPairsTest($begin, $end = '') - { - $objects = $this->objectModel->getWeekPairs($begin, $end = ''); - - if(dao::isError()) return dao::getError(); - - return $objects; - } + /** + * GetFromDB + * + * @param int $project + * @param string $date + * @access public + * @return object + */ public function getFromDBTest($project, $date) { @@ -34,15 +99,34 @@ class weeklyTest return $objects; } + /** + * Save data. + * + * @param int $project + * @param string $date + * @access public + * @return void + */ + public function saveTest($project, $date) { $objects = $this->objectModel->save($project, $date); if(dao::isError()) return dao::getError(); - return $objects; + $weekly = $this->objectModel->getFromDB($project, $date); + return $weekly; } + /** + * GetWeekSN + * + * @param string $begin + * @param string $date + * @access public + * @return int + */ + public function getWeekSNTest($begin, $date) { $objects = $this->objectModel->getWeekSN($begin, $date); @@ -52,6 +136,14 @@ class weeklyTest return $objects; } + /** + * Get monday for a date. + * + * @param string $date + * @access public + * @return date + */ + public function getThisMondayTest($date) { $objects = $this->objectModel->getThisMonday($date); @@ -61,6 +153,14 @@ class weeklyTest return $objects; } + /** + * GetThisSunday + * + * @param string $date + * @access public + * @return date + */ + public function getThisSundayTest($date) { $objects = $this->objectModel->getThisSunday($date); @@ -70,6 +170,14 @@ class weeklyTest return $objects; } + /** + * GetLastDay + * + * @param string $date + * @access public + * @return string + */ + public function getLastDayTest($date) { $objects = $this->objectModel->getLastDay($date); @@ -79,87 +187,167 @@ class weeklyTest return $objects; } + /** + * Test getStaff + * + * @param int $project + * @param string $date + * @access public + * @return array + */ public function getStaffTest($project, $date = '') { - $objects = $this->objectModel->getStaff($project, $date = ''); + $objects = $this->objectModel->getStaff($project, $date); if(dao::isError()) return dao::getError(); return $objects; } - public function getFinishedTest($project, $date = '', $pager = null) + /** + * Test getFinished + * + * @param int $project + * @param string $date + * @access public + * @return void + */ + public function getFinishedTest($project, $date = '') { - $objects = $this->objectModel->getFinished($project, $date = '', $pager = null); + $objects = $this->objectModel->getFinished($project, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test getPostponed + * + * @param int $project + * @param string $date + * @access public + * @return void + */ public function getPostponedTest($project, $date = '') { - $objects = $this->objectModel->getPostponed($project, $date = ''); + $objects = $this->objectModel->getPostponed($project, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test getTasksOfNextWeek + * + * @param int $project + * @param string $date + * @access public + * @return void + */ public function getTasksOfNextWeekTest($project, $date = '') { - $objects = $this->objectModel->getTasksOfNextWeek($project, $date = ''); + $objects = $this->objectModel->getTasksOfNextWeek($project, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test getWorkloadByType + * + * @param int $project + * @param string $date + * @access public + * @return object + */ public function getWorkloadByTypeTest($project, $date = '') { - $objects = $this->objectModel->getWorkloadByType($project, $date = ''); + $objects = $this->objectModel->getWorkloadByType($project, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test getPlanedTaskByWeek + * + * @param int $project + * @param string $date + * @access public + * @return array + */ public function getPlanedTaskByWeekTest($project, $date = '') { - $objects = $this->objectModel->getPlanedTaskByWeek($project, $date = ''); + $objects = $this->objectModel->getPlanedTaskByWeek($project, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test getPV + * + * @param int $project + * @param string $date + * @access public + * @return int + */ public function getPVTest($projectID, $date = '') { - $objects = $this->objectModel->getPV($projectID, $date = ''); + $objects = $this->objectModel->getPV($projectID, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test get EV data. + * + * @param int $projectID + * @param string $date + * @access public + * @return int + */ public function getEVTest($projectID, $date = '') { - $objects = $this->objectModel->getEV($projectID, $date = ''); + $objects = $this->objectModel->getEV($projectID, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test get AC data. + * + * @param int $project + * @param string $date + * @access public + * @return int + */ public function getACTest($project, $date = '') { - $objects = $this->objectModel->getAC($project, $date = ''); + $objects = $this->objectModel->getAC($project, $date); if(dao::isError()) return dao::getError(); return $objects; } + /** + * Test get SV data. + * + * @param int $ev + * @param int $pv + * @access public + * @return int + */ public function getSVTest($ev, $pv) { $objects = $this->objectModel->getSV($ev, $pv); @@ -169,6 +357,14 @@ class weeklyTest return $objects; } + /** + * Test getCV + * + * @param int $ev + * @param int $ac + * @access public + * @return int + */ public function getCVTest($ev, $ac) { $objects = $this->objectModel->getCV($ev, $ac); @@ -178,12 +374,20 @@ class weeklyTest return $objects; } + /** + * Test getTips + * + * @param string $type + * @param int $data + * @access public + * @return string + */ public function getTipsTest($type = 'progress', $data = 0) { - $objects = $this->objectModel->getTips($type = 'progress', $data = 0); + $objects = $this->objectModel->getTips($type, $data); if(dao::isError()) return dao::getError(); return $objects; } -} \ No newline at end of file +} diff --git a/test/data/job.yaml b/test/data/job.yaml index 08c13e0738..2d07519293 100644 --- a/test/data/job.yaml +++ b/test/data/job.yaml @@ -41,6 +41,12 @@ fields: - field: engine note: "引擎" range: jenkins,gitlab + - field: server + note: "服务器ID" + range: 3,1 + - field: pipeline + note: "流水线" + range: dave,[{"project":"1569"}] - field: triggerType note: "触发方式" range: tag,commit,schedule diff --git a/test/data/log.yaml b/test/data/log.yaml new file mode 100644 index 0000000000..9ac693b34a --- /dev/null +++ b/test/data/log.yaml @@ -0,0 +1,68 @@ +title: table zt_log +desc: "接口日志" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 1-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: objectType + note: "对象类型" + range: entry,webhook{9} + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: objectID + note: "对象ID" + range: 1-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: action + note: "操作日志ID" + range: 1-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: date + note: "日期" + range: "(-1M)-(1w)" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + prefix: "" + postfix: "" + - field: url + note: "请求地址" + range: "qcmmi" + prefix: "http://" + postfix: ".com" + loop: 0 + format: "" + - field: contentType + note: "内容类型" + range: "application/json" + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: data + note: "数据" + range: a-z + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: result + note: "结果" + range: a-z + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/notify.yaml b/test/data/notify.yaml new file mode 100644 index 0000000000..fca26c1104 --- /dev/null +++ b/test/data/notify.yaml @@ -0,0 +1,98 @@ +title: table zt_notify +desc: "消息通知" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 1-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: objectType + note: "对象类型" + range: mail + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: objectID + note: "对象ID" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: action + note: "操作记录ID" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: toList + note: "指派用户" + range: admin,user10,test10,dev10,top10 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: ccList + range: 0 + note: "" + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: subject + note: "主题" + range: 1-100 + prefix: "主题" + postfix: "" + loop: 0 + format: "" + - field: data + note: "记录数据" + range: 1-100 + prefix: "用户创建了任务" + postfix: "" + loop: 0 + format: "" + - field: createdBy + note: "创建者" + range: dev12,test12,admin + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: createdDate + note: "创建日期" + range: "(1M)-(1w)" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + prefix: "" + postfix: "" + loop: 0 + - field: sendTime + note: "发送日期" + range: "(1M)-(1w)" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + prefix: "" + postfix: "" + loop: 0 + - field: status + note: "状态" + range: wait,fail + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: failReason + note: "失败原因" + range: "" + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/pipeline.yaml b/test/data/pipeline.yaml index 60ad7e0b48..c4295ea9d7 100644 --- a/test/data/pipeline.yaml +++ b/test/data/pipeline.yaml @@ -3,24 +3,24 @@ author: Zeng gang version: "1.0" fields: - field: id - range: 1-2 + range: 1-3 - field: type - range: gitlab,sonarqube + range: gitlab,sonarqube,jenkins - field: name - range: gitlab服务器,sonarqube服务器 + range: gitlab服务器,sonarqube服务器,jenkins服务器 - field: url - range: [http://192.168.1.161:51080],[http://192.168.1.161:59001] + range: [http://10.0.1.161:51080],[http://10.0.1.161:59001],[http://10.0.1.161:58080] - field: account - range: [],[admin] + range: [],[admin]{2} - field: password - range: [],[UDJzc3cwcmQ=] + range: [],[UDJzc3cwcmQ=],[] - field: token - range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ= + range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=,1196c85ba525a268570df9da627e3a7b2d - field: private - range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc + range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc,ec8e41481723685d9106c88be5967c41 - field: createdBy range: admin - field: createdDate - range: [2021-12-09 11:23:35],[2022-01-12 08:47:37] + range: [2021-12-09 11:23:35],[2022-01-12 08:47:37],[2022-01-12 08:47:37] - field: deleted range: 0 diff --git a/test/data/usertpl.yaml b/test/data/usertpl.yaml new file mode 100644 index 0000000000..a282e2086f --- /dev/null +++ b/test/data/usertpl.yaml @@ -0,0 +1,47 @@ +title: table zt_usertpl +desc: "用户模块" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 1-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: account + range: admin,dev10,top10,test10,po10 + note: "用户名" + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: type + note: "类型" + range: task,story,bug,exportstory + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: title + note: "模板名" + range: 1-10000 + prefix: "模板名称" + postfix: "" + loop: 0 + format: "" + - field: content + note: "内容" + range: 1-10000 + prefix: "模块内容" + postfix: "" + loop: 0 + format: "" + - field: public + note: "是否公开" + range: 0,1 + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/weeklyreport.yaml b/test/data/weeklyreport.yaml index 3af89e6b9a..b7693c1b6b 100644 --- a/test/data/weeklyreport.yaml +++ b/test/data/weeklyreport.yaml @@ -21,10 +21,8 @@ fields: format: "" - field: weekStart note: "" - range: "(M)-(w):60s" - type: timestamp - format: "YYYY-MM-DD" - prefix: "" + range: "" + prefix: "2022-05-02" postfix: "" - field: pv range: 1-10 diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 7c4c86f244..d5e1252bb6 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -104,15 +104,18 @@ $builder->designspec = array('rows' => 120, 'extends' => array('designspec')); $builder->stage = array('rows' => 6, 'extends' => array('stage')); $builder->webhook = array('rows' => 7, 'extends' => array('webhook')); $builder->entry = array('rows' => 1, 'extends' => array('entry')); +$builder->log = array('rows' => 10, 'extends' => array('log')); $builder->weeklyreport = array('rows' => 10, 'extends' => array('weeklyreport')); $builder->metting = array('rows' => 10, 'extends' => array('meeting')); +$builder->usertpl = array('rows' => 10, 'extends' => array('usertpl')); -$builder->pipeline = array('rows' => 2, 'extends' => array('pipeline')); +$builder->pipeline = array('rows' => 3, 'extends' => array('pipeline')); $builder->holiday = array('rows' => 100, 'extends' => array('holiday')); $builder->repo = array('rows' => 1, 'extends' => array('repo')); $builder->job = array('rows' => 2, 'extends' => array('job')); $builder->mr = array('rows' => 1, 'extends' => array('mr')); $builder->oauth = array('rows' => 90, 'extends' => array('oauth')); +$builder->notify = array('rows' => 10, 'extends' => array('notify')); $builder->vm = array('rows' => 1, 'extends' => array('vm')); $builder->vmtemplate = array('rows' => 1, 'extends' => array('vmtemplate')); diff --git a/test/model/ci/setmenu.php b/test/model/ci/setmenu.php new file mode 100644 index 0000000000..1b2c298dc3 --- /dev/null +++ b/test/model/ci/setmenu.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +setMenu(); +cid=1 +pid=1 + +替换devops模块的参数 >> 代码|repo|browse|repoID=1 + +*/ + +$ci = new ciTest(); + +r($ci->setMenuTest()) && p('link') && e('代码|repo|browse|repoID=1'); //替换devops模块导航的参数 diff --git a/test/model/ci/synccompilestatus.php b/test/model/ci/synccompilestatus.php new file mode 100644 index 0000000000..80d017226e --- /dev/null +++ b/test/model/ci/synccompilestatus.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +syncCompileStatus(); +cid=1 +pid=1 + +同步jenkins构建结果 >> created + +*/ + +$ci = new ciTest(); + +r($ci->syncCompileStatusTest(1)) && p('status') && e('created'); //同步jenkins构建结果 diff --git a/test/model/doc/buildbrowseswitch.php b/test/model/doc/buildbrowseswitch.php new file mode 100644 index 0000000000..b371650616 --- /dev/null +++ b/test/model/doc/buildbrowseswitch.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +buildBrowseSwitch(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->buildBrowseSwitchTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/buildcollectbutton4doc.php b/test/model/doc/buildcollectbutton4doc.php new file mode 100644 index 0000000000..d2397de676 --- /dev/null +++ b/test/model/doc/buildcollectbutton4doc.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +buildCollectButton4Doc(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->buildCollectButton4DocTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/buildcreatebutton4doc.php b/test/model/doc/buildcreatebutton4doc.php new file mode 100644 index 0000000000..f6faa0f554 --- /dev/null +++ b/test/model/doc/buildcreatebutton4doc.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +buildCreateButton4Doc(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->buildCreateButton4DocTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/buildcrumbtitle.php b/test/model/doc/buildcrumbtitle.php new file mode 100644 index 0000000000..a23de3163a --- /dev/null +++ b/test/model/doc/buildcrumbtitle.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +buildCrumbTitle(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->buildCrumbTitleTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/checkautoloadpage.php b/test/model/doc/checkautoloadpage.php new file mode 100644 index 0000000000..4d77393db1 --- /dev/null +++ b/test/model/doc/checkautoloadpage.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +checkAutoloadPage(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->checkAutoloadPageTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/checkprivdoc.php b/test/model/doc/checkprivdoc.php new file mode 100644 index 0000000000..c8b39faad5 --- /dev/null +++ b/test/model/doc/checkprivdoc.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +checkPrivDoc(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->checkPrivDocTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/checkprivlib.php b/test/model/doc/checkprivlib.php new file mode 100644 index 0000000000..455b604d6f --- /dev/null +++ b/test/model/doc/checkprivlib.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +checkPrivLib(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->checkPrivLibTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/create.php b/test/model/doc/create.php new file mode 100644 index 0000000000..60d16e880e --- /dev/null +++ b/test/model/doc/create.php @@ -0,0 +1,55 @@ +#!/usr/bin/env php +create(); +cid=1 +pid=1 + +创建产品文档 >> 1,新建产品文档 +创建项目文档 >> 27,新建项目文档 +创建执行文档 >> 127,新建执行文档 +创建自定义文档 >> text, +创建url文档 >> url,www.baidu.com +创建Markdown文档 >> text,Markdown +创建私有文档 >> private +创建自定义文档 >> custom,1,2,3 +不输入文档库 >> 『所属文档库』不能为空。 +不输入标题 >> 『文档标题』不能为空。 + +*/ +$libIDs = array('1', '117', '217', '821'); +$type = array('text', 'url', 'execution', 'custom', ''); +$acl = array('', 'open', 'custom', 'private'); +$groups = array('1', '2', '3'); +$users = array('admin', 'dev1', 'dev10'); + +$createProductDoc = array('lib' => $libIDs[0], 'title' => '新建产品文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$createProjectDoc = array('lib' => $libIDs[1], 'title' => '新建项目文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$createExecutionDoc = array('lib' => $libIDs[2], 'title' => '新建执行文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$createCustomDoc = array('lib' => $libIDs[3], 'title' => '新建自定义文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$createUrlDoc = array('lib' => $libIDs[0], 'title' => '新建URL文档', 'type' => $type[1], 'url' => 'www.baidu.com', 'acl' => $acl[1]); +$createMarkdownDoc = array('lib' => $libIDs[0], 'title' => '新建markdown文档', 'type' => $type[0], 'contentType' => 'markdown', 'contentMarkdown' => 'Markdown', 'acl' => $acl[1]); +$privateDoc = array('lib' => $libIDs[0], 'title' => '新建私有文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[3]); +$customDoc = array('lib' => $libIDs[0], 'title' => '新建自定义文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[2], 'groups' => $groups, 'users' => $users); +$noLib = array('title' => '无文档库', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$noTitle = array('lib' => $libIDs[0], 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$noType = array('lib' => $libIDs[0], 'title' => '无TYPE', 'contentType' => 'html', 'acl' => $acl[1]); + +$doc = new docTest(); +r($doc->createTest($createProductDoc)) && p('0:product,title') && e('1,新建产品文档'); //创建产品文档 +r($doc->createTest($createProjectDoc)) && p('0:project,title') && e('27,新建项目文档'); //创建项目文档 +r($doc->createTest($createExecutionDoc)) && p('0:execution,title') && e('127,新建执行文档'); //创建执行文档 +r($doc->createTest($createCustomDoc)) && p('0:type,draft') && e('text,'); //创建自定义文档 +r($doc->createTest($createUrlDoc)) && p('0:type,draft') && e('url,www.baidu.com'); //创建url文档 +r($doc->createTest($createMarkdownDoc)) && p('0:type,draft') && e('text,Markdown'); //创建Markdown文档 +r($doc->createTest($privateDoc)) && p('0:acl') && e('private'); //创建私有文档 +r($doc->createTest($customDoc)) && p('0:acl,groups') && e('custom,1,2,3'); //创建自定义文档 +r($doc->createTest($noLib)) && p('lib') && e('『所属文档库』不能为空。');//不输入文档库 +r($doc->createTest($noTitle)) && p('title:0') && e('『文档标题』不能为空。'); //不输入标题 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/doc/createapilib.php b/test/model/doc/createapilib.php new file mode 100644 index 0000000000..442157c270 --- /dev/null +++ b/test/model/doc/createapilib.php @@ -0,0 +1,41 @@ +#!/usr/bin/env php +createApiLib(); +cid=1 +pid=1 + +新建公有接口库 >> api;新建api文档库 +新建私有接口库 >> private;www.zentaopms.com +新建自定义接口库 >> custom;1,2,3;admin,dev1,dev10 +接口库名称为空 >> 『接口库名称』不能为空。 +重复创建接口库 >> 『接口库名称』已经有『新建api文档库』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 + +*/ +$acl = array('', 'open', 'custom', 'private'); +$groups = array('1', '2', '3'); +$users = array('admin', 'dev1', 'dev10'); + +$openApilib = array('name' => '新建api文档库', 'acl' => $acl[1], 'baseUrl' => 'www.zentaopms.com'); +$privateApilib = array('name' => '新建私有api文档库', 'acl' => $acl[3], 'baseUrl' => 'www.zentaopms.com'); +$customApilib = array('name' => '新建自定义api文档库', 'acl' => $acl[2], 'baseUrl' => 'www.zentaopms.com', 'groups' => $groups, 'users' => $users); +$noName = array('name' => '', 'acl' => $acl[1], 'baseUrl' => 'www.zentaopms.com'); +$noAcl = array('name' => '无权限', 'acl' => $acl[0], 'baseUrl' => 'www.zentaopms.com'); +$noBaseUrl = array('name' => 'noBaseUrl', 'acl' => $acl[0], 'baseUrl' => ''); + +$doc = new docTest(); + +r($doc->createApiLibTest($openApilib)) && p('type;name') && e('api;新建api文档库'); //新建公有接口库 +r($doc->createApiLibTest($privateApilib)) && p('acl;baseUrl') && e('private;www.zentaopms.com'); //新建私有接口库 +r($doc->createApiLibTest($customApilib)) && p('acl;groups;users') && e('custom;1,2,3;admin,dev1,dev10');//新建自定义接口库 +r($doc->createApiLibTest($noName)) && p('name:0') && e('『接口库名称』不能为空。'); //接口库名称为空 +r($doc->createApiLibTest($noAcl)) && p('acl') && e(''); //接口库权限为空 +r($doc->createApiLibTest($noBaseUrl)) && p('baseUrl') && e(''); //接口库地址为空 +r($doc->createApiLibTest($openApilib)) && p('name:0') && e('『接口库名称』已经有『新建api文档库』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。');//重复创建接口库 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/doc/createlib.php b/test/model/doc/createlib.php new file mode 100644 index 0000000000..eaebcde663 --- /dev/null +++ b/test/model/doc/createlib.php @@ -0,0 +1,56 @@ +#!/usr/bin/env php +createLib(); +cid=1 +pid=1 + +新建公有产品文档库 >> product;新建文档库 +新建公有项目文档库 >> project;default +新建公有执行文档库 >> execution;rnd +新建公有自定义文档库 >> custom;0 +新建私有自定义文档库 >> product;1,2,3;admin,dev1,dev10 +新建无产品产品文档库 >> 『产品库』应当是数字。 +新建无项目项目文档库 >> 『project』应当是数字。 +新建无执行执行文档库 >> 『迭代库』应当是数字。 + +*/ +$type = array('product', 'project', 'execution', 'custom', ''); +$product = array('', '1'); +$project = array('', '11'); +$execution = array('', '101'); +$name = array('', '新建文档库'); +$acl = array('', 'default', 'custom'); +$groups = array('1', '2', '3'); +$users = array('admin', 'dev1', 'dev10'); + +$createProduct = array('type' => $type[0], 'product' => $product[1], 'name' => $name[1], 'acl' => $acl[1]); +$createProject = array('type' => $type[1], 'project' => $project[1], 'name' => $name[1], 'acl' => $acl[1]); +$createExecution = array('type' => $type[2], 'execution' => $execution[1], 'name' => $name[1], 'acl' => $acl[1]); +$createCustom = array('type' => $type[3], 'name' => $name[1], 'acl' => $acl[1]); +$customLib = array('type' => $type[0], 'product' => $product[1], 'name' => $name[1], 'acl' => $acl[2], 'groups' => $groups, 'users' => $users); +$noType = array('type' => $type[4], 'product' => $product[1], 'name' => $name[1], 'acl' => $acl[1]); +$noProduct = array('type' => $type[0], 'product' => $product[0], 'name' => $name[1], 'acl' => $acl[1]); +$noProject = array('type' => $type[1], 'project' => $project[0], 'name' => $name[1], 'acl' => $acl[1]); +$noExecution = array('type' => $type[2], 'execution' => $execution[0], 'name' => $name[1], 'acl' => $acl[1]); +$noAcl = array('type' => $type[0], 'product' => $product[1], 'name' => $name[1], 'acl' => $acl[0]); + +$doc = new docTest(); + +r($doc->createLibTest($createProduct)) && p('type;name') && e('product;新建文档库'); //新建公有产品文档库 +r($doc->createLibTest($createProject)) && p('type;acl') && e('project;default'); //新建公有项目文档库 +r($doc->createLibTest($createExecution)) && p('type;vision') && e('execution;rnd'); //新建公有执行文档库 +r($doc->createLibTest($createCustom)) && p('type;project') && e('custom;0'); //新建公有自定义文档库 +r($doc->createLibTest($customLib)) && p('type;groups;users') && e('product;1,2,3;admin,dev1,dev10');//新建私有自定义文档库 +r($doc->createLibTest($noType)) && p('type') && e(''); //新建无类型文档库 +r($doc->createLibTest($noProduct)) && p('product:0') && e('『产品库』应当是数字。'); //新建无产品产品文档库 +r($doc->createLibTest($noProject)) && p('project:0') && e('『project』应当是数字。'); //新建无项目项目文档库 +r($doc->createLibTest($noExecution)) && p('execution:0') && e('『迭代库』应当是数字。'); //新建无执行执行文档库 +r($doc->createLibTest($noAcl)) && p('acl') && e(''); //新建无权限控制文档库 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/doc/extractketablecss.php b/test/model/doc/extractketablecss.php new file mode 100644 index 0000000000..326c6c9df9 --- /dev/null +++ b/test/model/doc/extractketablecss.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +extractKETableCSS(); +cid=1 +pid=1 + + + +*/ +global $tester; +$doc = $tester->loadModel('doc'); +$content = 'test'; +$css = ''; + +r($doc->extractKETableCSS($content)) && p() && e('0'); //未过滤数据查询 +r($doc->extractKETableCSS($css)) && p() && e('.ke-table1{border:1px #000000 solid}');//过滤后数据查询 diff --git a/test/model/doc/filldocsintree.php b/test/model/doc/filldocsintree.php new file mode 100644 index 0000000000..28aa89df22 --- /dev/null +++ b/test/model/doc/filldocsintree.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +fillDocsInTree(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->fillDocsInTreeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getalllibgroups.php b/test/model/doc/getalllibgroups.php new file mode 100644 index 0000000000..90c886c9e6 --- /dev/null +++ b/test/model/doc/getalllibgroups.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getAllLibGroups(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getAllLibGroupsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getalllibsbytype.php b/test/model/doc/getalllibsbytype.php new file mode 100644 index 0000000000..8f213598eb --- /dev/null +++ b/test/model/doc/getalllibsbytype.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getAllLibsByType(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getAllLibsByTypeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getapilibs.php b/test/model/doc/getapilibs.php new file mode 100644 index 0000000000..012d9f8dbd --- /dev/null +++ b/test/model/doc/getapilibs.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +getApiLibs(); +cid=1 +pid=1 + +查询全部接口库 >> api +查询额外的产品库 >> product +查询接口库 >> 接口库 +查询全部接口库统计 >> 10 +查询额外的产品库统计 >> 11 +查询接口库统计 >> 10 + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$docLibIDList = array('0', '17', '901'); + +r($doc->getApiLibs($docLibIDList[0])) && p('901:type') && e('api'); //查询全部接口库 +r($doc->getApiLibs($docLibIDList[1])) && p('17:type') && e('product');//查询额外的产品库 +r($doc->getApiLibs($docLibIDList[2])) && p('902:name') && e('接口库'); //查询接口库 +r(count($doc->getApiLibs($docLibIDList[0]))) && p() && e('10'); //查询全部接口库统计 +r(count($doc->getApiLibs($docLibIDList[1]))) && p() && e('11'); //查询额外的产品库统计 +r(count($doc->getApiLibs($docLibIDList[2]))) && p() && e('10'); //查询接口库统计 \ No newline at end of file diff --git a/test/model/doc/getapimoduletree.php b/test/model/doc/getapimoduletree.php new file mode 100644 index 0000000000..95670d6d74 --- /dev/null +++ b/test/model/doc/getapimoduletree.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getApiModuleTree(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getApiModuleTreeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getbyid.php b/test/model/doc/getbyid.php new file mode 100644 index 0000000000..a34f860421 --- /dev/null +++ b/test/model/doc/getbyid.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getById(); +cid=1 +pid=1 + + + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$docIDList = array('0', '17', '1'); +$versionList = array('0', '1', '2'); + +r($doc->getById($docIDList[1], $versionList[0])) && p('product;title') && e('17;文档标题17'); //正常根据id查询doc +r($doc->getById($docIDList[0], $versionList[0])) && p() && e('0'); //查询不存在的doc +r($doc->getById($docIDList[2], $versionList[1])) && p('version;content') && e('2;文档正文1'); //查询版本为1的文档内容 +r($doc->getById($docIDList[2], $versionList[2])) && p('version;content') && e('2;文档正文901'); //查询版本为2的文档内容 \ No newline at end of file diff --git a/test/model/doc/getbyidlist.php b/test/model/doc/getbyidlist.php new file mode 100644 index 0000000000..74ec12d822 --- /dev/null +++ b/test/model/doc/getbyidlist.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getByIdList(); +cid=1 +pid=1 + + + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$docIDList = array('0', '117', '1', '217'); + +r($doc->getByIdList($docIDList)) && p('901:lib,content') && e('1,文档正文901');//正常查询文档库下的文档 +r(count($doc->getByIdList($docIDList))) && p() && e('3'); //查询文档库下的文档统计 \ No newline at end of file diff --git a/test/model/doc/getdocmenu.php b/test/model/doc/getdocmenu.php new file mode 100644 index 0000000000..f1cc218282 --- /dev/null +++ b/test/model/doc/getdocmenu.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +getDocMenu(); +cid=1 +pid=1 + + + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$docIDList = array('0', '17'); +$parents = array('0', '3637'); +$orderBy = array('name_asc', 'id_desc'); +$browseTypes = array('collectedbyme', ''); + +r($doc->getDocMenu($docIDList[1], $parents[0], $orderBy[0], $browseTypes[1])) && p('3637:name,parent') && e('目录17,0'); //无子目录查询 +r($doc->getDocMenu($docIDList[1], $parents[1], $orderBy[0], $browseTypes[1])) && p('3754:name,parent') && e('子目录34,3637');//有子目录查询 +r(count($doc->getDocMenu($docIDList[1], $parents[1], $orderBy[0], $browseTypes[1]))) && p() && e('2'); //子目录查询统计 +r($doc->getDocMenu($docIDList[0], $parents[0], $orderBy[0], $browseTypes[0])) && p() && e('0'); //无效数据查询 \ No newline at end of file diff --git a/test/model/doc/getdocs.php b/test/model/doc/getdocs.php new file mode 100644 index 0000000000..e782b17128 --- /dev/null +++ b/test/model/doc/getdocs.php @@ -0,0 +1,26 @@ +#!/usr/bin/env php +getDocs(); +cid=1 +pid=1 + +正常获取文档库下的文档 >> 1,文档标题1 +获取文档目录下的文档 >> 2,3622 +libID为空查询 >> 900 + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$libIDlist = array('1', '2', ''); +$moduleIDList = array('0','3621', '3622'); +$orderBy = 'id_desc'; + +r($doc->getDocs($libIDlist[0], $moduleIDList[0], $orderBy)) && p('1:lib,title') && e('1,文档标题1');//正常获取文档库下的文档 +r($doc->getDocs($libIDlist[1], $moduleIDList, $orderBy)) && p('2:lib,module') && e('2,3622'); //获取文档目录下的文档 +r(count($doc->getDocs($libIDlist[2], $moduleIDList[0], $orderBy))) && p() && e('900'); //libID为空查询 \ No newline at end of file diff --git a/test/model/doc/getdocsbybrowsetype.php b/test/model/doc/getdocsbybrowsetype.php new file mode 100644 index 0000000000..0b987b50e8 --- /dev/null +++ b/test/model/doc/getdocsbybrowsetype.php @@ -0,0 +1,39 @@ +#!/usr/bin/env php +getDocsByBrowseType(); +cid=1 +pid=1 + +all类型查询 >> 1,文档标题1 +openedbyme类型查询 >> 2,正常产品2 +editedbyme类型查询 >> 0 +byediteddate类型查询 >> 900,admin +collectedbyme类型查询 >> 0 +test类型查询 >> 0 +加上moduleId查询 >> 关键词1 +all类型查询 >> 900 +openedbyme类型查询 >> 900 +byediteddate类型查询 >> 900 + +*/ +$browseType = array('all', 'openedbyme', 'editedbyme', 'byediteddate', 'collectedbyme', 'test'); +$moduleIds = array('', '3621', '3622', '3623'); + +$doc = new docTest(); + +r($doc->getDocsByBrowseTypeTest($browseType[0], $moduleIds[0])) && p('1:lib,title') && e('1,文档标题1');//all类型查询 +r($doc->getDocsByBrowseTypeTest($browseType[1], $moduleIds[0])) && p('2:lib,objectName') && e('2,正常产品2');//openedbyme类型查询 +r($doc->getDocsByBrowseTypeTest($browseType[2], $moduleIds[0])) && p() && e('0'); //editedbyme类型查询 +r($doc->getDocsByBrowseTypeTest($browseType[3], $moduleIds[0])) && p('900:lib,users') && e('900,admin'); //byediteddate类型查询 +r($doc->getDocsByBrowseTypeTest($browseType[4], $moduleIds[0])) && p() && e('0'); //collectedbyme类型查询 +r($doc->getDocsByBrowseTypeTest($browseType[5], $moduleIds[0])) && p() && e('0'); //test类型查询 +r($doc->getDocsByBrowseTypeTest($browseType[3], $moduleIds)) && p('1:keywords') && e('关键词1'); //加上moduleId查询 +r(count($doc->getDocsByBrowseTypeTest($browseType[0], $moduleIds[0]))) && p('1:lib,title') && e('900'); //all类型查询 +r(count($doc->getDocsByBrowseTypeTest($browseType[1], $moduleIds[0]))) && p('2:lib,objectName') && e('900'); //openedbyme类型查询 +r(count($doc->getDocsByBrowseTypeTest($browseType[3], $moduleIds[0]))) && p('900:lib,users') && e('900'); //byediteddate类型查询 \ No newline at end of file diff --git a/test/model/doc/getdoctree.php b/test/model/doc/getdoctree.php new file mode 100644 index 0000000000..247c9b34ec --- /dev/null +++ b/test/model/doc/getdoctree.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getDocTree(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getDocTreeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getexecutionmodulepairs.php b/test/model/doc/getexecutionmodulepairs.php new file mode 100644 index 0000000000..1b9299fbb2 --- /dev/null +++ b/test/model/doc/getexecutionmodulepairs.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getExecutionModulePairs(); +cid=1 +pid=1 + +正常查询 >> 子目录200 +正常查询统计 >> 4520 + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +r($doc->getExecutionModulePairs()) && p('3920') && e('子目录200');//正常查询 +r(count($doc->getExecutionModulePairs())) && p() && e('4520'); //正常查询统计 \ No newline at end of file diff --git a/test/model/doc/getfileicon.php b/test/model/doc/getfileicon.php new file mode 100644 index 0000000000..7dc8bf3819 --- /dev/null +++ b/test/model/doc/getfileicon.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getFileIcon(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getFileIconTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getfilesourcepairs.php b/test/model/doc/getfilesourcepairs.php new file mode 100644 index 0000000000..f4f4279d42 --- /dev/null +++ b/test/model/doc/getfilesourcepairs.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getFileSourcePairs(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getFileSourcePairsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getlibbyid.php b/test/model/doc/getlibbyid.php new file mode 100644 index 0000000000..90ffbf10b4 --- /dev/null +++ b/test/model/doc/getlibbyid.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +getLibById(); +cid=1 +pid=1 + +正常查询文档库 >> 产品主库 +查询不存在的文档库 >> 0 + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$docLibIDList = array('0', '17'); + +r($doc->getLibById($docLibIDList[1])) && p('name') && e('产品主库');//正常查询文档库 +r($doc->getLibById($docLibIDList[0])) && p() && e('0'); //查询不存在的文档库 \ No newline at end of file diff --git a/test/model/doc/getlibfiles.php b/test/model/doc/getlibfiles.php new file mode 100644 index 0000000000..9c9b825e20 --- /dev/null +++ b/test/model/doc/getlibfiles.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getLibFiles(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getLibFilesTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getlibidlistbyproject.php b/test/model/doc/getlibidlistbyproject.php new file mode 100644 index 0000000000..7b73aa1285 --- /dev/null +++ b/test/model/doc/getlibidlistbyproject.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getLibIdListByProject(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getLibIdListByProjectTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getlibs.php b/test/model/doc/getlibs.php new file mode 100644 index 0000000000..dc0e76e9a4 --- /dev/null +++ b/test/model/doc/getlibs.php @@ -0,0 +1,65 @@ +#!/usr/bin/env php +getLibs(); +cid=1 +pid=1 + +全部文档库查询 >> 产品主库 +api文档库查询 >> 0 +产品文档库查询 >> 产品主库 +项目文档库查询 >> 项目主库 +执行文档库查询 >> 迭代主库 +产品文档库关联查询 >> 正常产品1 / 产品主库 +notdoc查询 >> 产品主库 +额外文档库查询 >> 产品主库 +产品单独查询 >> 产品主库 +项目单独查询 >> 项目主库 +执行单独查询 >> 迭代主库 +全部文档库查询统计 >> 900 +产品文档库查询统计 >> 100 +项目文档库查询统计 >> 90 +执行文档库查询统计 >> 630 +产品文档库关联查询统计 >> 900 +notdoc查询统计 >> 900 +额外文档库查询统计 >> 2 +产品单独查询统计 >> 1 +项目单独查询统计 >> 1 +执行单独查询统计 >> 1 + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$types = array('all', 'api', 'product', 'project', 'execution'); +$extra = array('', 'withObject', 'notdoc'); +$appendLibs = array('17', '1'); +$objectIDs = array('1', '11', '101', '0'); +//var_dump($doc->getLibs($types[4], $extra[0], '', $objectIDs[2]));die; +r($doc->getLibs($types[0], $extra[0], '', $objectIDs[3])) && p('1') && e('产品主库'); //全部文档库查询 +r($doc->getLibs($types[1], $extra[0], '', $objectIDs[3])) && p() && e('0'); //api文档库查询 +r($doc->getLibs($types[2], $extra[0], '', $objectIDs[3])) && p('10') && e('产品主库'); //产品文档库查询 +r($doc->getLibs($types[3], $extra[0], '', $objectIDs[3])) && p('110') && e('项目主库'); //项目文档库查询 +r($doc->getLibs($types[4], $extra[0], '', $objectIDs[3])) && p('200') && e('迭代主库'); //执行文档库查询 +r($doc->getLibs($types[0], $extra[1], '', $objectIDs[3])) && p('1') && e('正常产品1 / 产品主库');//产品文档库关联查询 +r($doc->getLibs($types[0], $extra[2], '', $objectIDs[3])) && p('1') && e('产品主库'); //notdoc查询 +r($doc->getLibs($types[1], $extra[0], $appendLibs, $objectIDs[3])) && p('1') && e('产品主库'); //额外文档库查询 +r($doc->getLibs($types[2], $extra[0], '', $objectIDs[0])) && p('1') && e('产品主库'); //产品单独查询 +r($doc->getLibs($types[3], $extra[0], '', $objectIDs[1])) && p('101') && e('项目主库'); //项目单独查询 +r($doc->getLibs($types[4], $extra[0], '', $objectIDs[2])) && p('191') && e('迭代主库'); //执行单独查询 + +r(count($doc->getLibs($types[0], $extra[0], '', $objectIDs[3]))) && p() && e('900');//全部文档库查询统计 +r(count($doc->getLibs($types[2], $extra[0], '', $objectIDs[3]))) && p() && e('100');//产品文档库查询统计 +r(count($doc->getLibs($types[3], $extra[0], '', $objectIDs[3]))) && p() && e('90'); //项目文档库查询统计 +r(count($doc->getLibs($types[4], $extra[0], '', $objectIDs[3]))) && p() && e('630');//执行文档库查询统计 +r(count($doc->getLibs($types[0], $extra[1], '', $objectIDs[3]))) && p() && e('900');//产品文档库关联查询统计 +r(count($doc->getLibs($types[0], $extra[2], '', $objectIDs[3]))) && p() && e('900');//notdoc查询统计 +r(count($doc->getLibs($types[1], $extra[0], $appendLibs, $objectIDs[3]))) && p() && e('2'); //额外文档库查询统计 +r(count($doc->getLibs($types[2], $extra[0], '', $objectIDs[0]))) && p() && e('1'); //产品单独查询统计 +r(count($doc->getLibs($types[3], $extra[0], '', $objectIDs[1]))) && p() && e('1'); //项目单独查询统计 +r(count($doc->getLibs($types[4], $extra[0], '', $objectIDs[2]))) && p() && e('1'); //执行单独查询统计 \ No newline at end of file diff --git a/test/model/doc/getlibsbyobject.php b/test/model/doc/getlibsbyobject.php new file mode 100644 index 0000000000..04f9d2bfd4 --- /dev/null +++ b/test/model/doc/getlibsbyobject.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getLibsByObject(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getLibsByObjectTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getlimitlibs.php b/test/model/doc/getlimitlibs.php new file mode 100644 index 0000000000..2d1f7cdda2 --- /dev/null +++ b/test/model/doc/getlimitlibs.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getLimitLibs(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getLimitLibsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getobjectsbydoc.php b/test/model/doc/getobjectsbydoc.php new file mode 100644 index 0000000000..7a6af46349 --- /dev/null +++ b/test/model/doc/getobjectsbydoc.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getObjectsByDoc(); +cid=1 +pid=1 + + + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$docIdList = array('17', '117', '217'); + +r($doc->getObjectsByDoc($docIdList)) && p('0:27;1:127;2:17') && e('项目17;迭代27;正常产品17');//查询文档库的项目产品迭代 \ No newline at end of file diff --git a/test/model/doc/getorderedobjects.php b/test/model/doc/getorderedobjects.php new file mode 100644 index 0000000000..bd315aaafc --- /dev/null +++ b/test/model/doc/getorderedobjects.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getOrderedObjects(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getOrderedObjectsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getpreandnextdoc.php b/test/model/doc/getpreandnextdoc.php new file mode 100644 index 0000000000..0e9019503d --- /dev/null +++ b/test/model/doc/getpreandnextdoc.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getPreAndNextDoc(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getPreAndNextDocTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getprivdocs.php b/test/model/doc/getprivdocs.php new file mode 100644 index 0000000000..2aa2c347ff --- /dev/null +++ b/test/model/doc/getprivdocs.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getPrivDocs(); +cid=1 +pid=1 + +查询单条doc >> 1 +查询多条doc >> 1;2 +查询模块doc >> 1;2 +不传入libid查询统计 >> 900 + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +$libIDlist = array('1', '2', ''); +$moduleIDList = array('0','3621', '3622'); + +r($doc->getPrivDocs($libIDlist[0], $moduleIDList[0])) && p('1') && e('1'); //查询单条doc +r($doc->getPrivDocs($libIDlist, $moduleIDList[0])) && p('1;2') && e('1;2');//查询多条doc +r($doc->getPrivDocs($libIDlist, $moduleIDList)) && p('1;2') && e('1;2');//查询模块doc +r(count($doc->getPrivDocs($libIDlist[2], $moduleIDList[0]))) && p() && e('900');//不传入libid查询统计 \ No newline at end of file diff --git a/test/model/doc/getprivlibsbydoc.php b/test/model/doc/getprivlibsbydoc.php new file mode 100644 index 0000000000..df33fddd9a --- /dev/null +++ b/test/model/doc/getprivlibsbydoc.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getPrivLibsByDoc(); +cid=1 +pid=1 + +正常查询 >> 900 +正常查询统计 >> 600 + +*/ +global $tester; +$doc = $tester->loadModel('doc'); + +r($doc->getPrivLibsByDoc()) && p('900') && e('900');//正常查询 +r(count($doc->getPrivLibsByDoc())) && p() && e('600');//正常查询统计 \ No newline at end of file diff --git a/test/model/doc/getproductcrumb.php b/test/model/doc/getproductcrumb.php new file mode 100644 index 0000000000..b252657206 --- /dev/null +++ b/test/model/doc/getproductcrumb.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getProductCrumb(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getProductCrumbTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getstatisticinfo.php b/test/model/doc/getstatisticinfo.php new file mode 100644 index 0000000000..26ceba1733 --- /dev/null +++ b/test/model/doc/getstatisticinfo.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getStatisticInfo(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getStatisticInfoTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/getsublibgroups.php b/test/model/doc/getsublibgroups.php new file mode 100644 index 0000000000..5e01e31131 --- /dev/null +++ b/test/model/doc/getsublibgroups.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getSubLibGroups(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getSubLibGroupsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/gettoandcclist.php b/test/model/doc/gettoandcclist.php new file mode 100644 index 0000000000..8be6905993 --- /dev/null +++ b/test/model/doc/gettoandcclist.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getToAndCcList(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getToAndCcListTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/gettreemenu.php b/test/model/doc/gettreemenu.php new file mode 100644 index 0000000000..d94649bdaf --- /dev/null +++ b/test/model/doc/gettreemenu.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getTreeMenu(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->getTreeMenuTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/printchildmodule.php b/test/model/doc/printchildmodule.php new file mode 100644 index 0000000000..9a237d4e96 --- /dev/null +++ b/test/model/doc/printchildmodule.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +printChildModule(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->printChildModuleTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/savedraft.php b/test/model/doc/savedraft.php new file mode 100644 index 0000000000..9153c3fc9d --- /dev/null +++ b/test/model/doc/savedraft.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +saveDraft(); +cid=1 +pid=1 + + + +*/ +$docIDList = array('17', '118', '217'); +$content = array('content' => '测试'); + +$doc = new docTest(); +r($doc->saveDraftTest($docIDList[0], $content)) && p('17:draft') && e('测试');//产品文档内容保存 +r($doc->saveDraftTest($docIDList[1], $content)) && p('118:draft') && e('测试');//项目文档内容保存 +r($doc->saveDraftTest($docIDList[2], $content)) && p('217:draft') && e('测试');//执行文档内容保存 +r($doc->saveDraftTest($docIDList[0])) && p('17:draft') && e('测试');//文档无内容保存 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/doc/select.php b/test/model/doc/select.php new file mode 100644 index 0000000000..76d998c270 --- /dev/null +++ b/test/model/doc/select.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +select(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->selectTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/setfastmenu.php b/test/model/doc/setfastmenu.php new file mode 100644 index 0000000000..102ce1f6d8 --- /dev/null +++ b/test/model/doc/setfastmenu.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +setFastMenu(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->setFastMenuTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/setlibusers.php b/test/model/doc/setlibusers.php new file mode 100644 index 0000000000..0485e11ee1 --- /dev/null +++ b/test/model/doc/setlibusers.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +setLibUsers(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->setLibUsersTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/setmenubytype.php b/test/model/doc/setmenubytype.php new file mode 100644 index 0000000000..c1b08d8df8 --- /dev/null +++ b/test/model/doc/setmenubytype.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +setMenuByType(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->setMenuByTypeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/statlibcounts.php b/test/model/doc/statlibcounts.php new file mode 100644 index 0000000000..730df24862 --- /dev/null +++ b/test/model/doc/statlibcounts.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +statLibCounts(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->statLibCountsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/summary.php b/test/model/doc/summary.php new file mode 100644 index 0000000000..1c750a7518 --- /dev/null +++ b/test/model/doc/summary.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +summary(); +cid=1 +pid=1 + + + +*/ + +$doc = new docTest(); + +r($doc->summaryTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/doc/update.php b/test/model/doc/update.php new file mode 100644 index 0000000000..21ee7ccc0c --- /dev/null +++ b/test/model/doc/update.php @@ -0,0 +1,47 @@ +#!/usr/bin/env php +update(); +cid=1 +pid=1 + + + +*/ +$docID = array('1', '2', '3', '4', '5', '6', '7', '8'); +$libIDs = array('1', '117', '217', '821'); +$type = array('text', 'url', 'execution', 'custom', ''); +$acl = array('', 'open', 'custom', 'private'); +$groups = array('1', '2', '3'); +$users = array('admin', 'dev1', 'dev10'); + +$updateProductDoc = array('lib' => $libIDs[0], 'title' => '修改产品文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$updateProjectDoc = array('lib' => $libIDs[1], 'title' => '修改项目文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$updateExecutionDoc = array('lib' => $libIDs[2], 'title' => '修改执行文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$updateCustomDoc = array('lib' => $libIDs[3], 'title' => '修改自定义文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$updateUrlDoc = array('lib' => $libIDs[0], 'title' => '修改URL文档', 'type' => $type[1], 'url' => 'www.baidu.com', 'acl' => $acl[1]); +$privateDoc = array('lib' => $libIDs[0], 'title' => '修改私有文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[3]); +$customDoc = array('lib' => $libIDs[0], 'title' => '修改自定义文档', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[2], 'groups' => $groups, 'users' => $users); +$noLib = array('title' => '无文档库', 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$noTitle = array('lib' => $libIDs[0], 'type' => $type[0], 'contentType' => 'html', 'acl' => $acl[1]); +$noType = array('lib' => $libIDs[0], 'title' => '无TYPE', 'contentType' => 'html', 'acl' => $acl[1]); + +$doc = new docTest(); + +r($doc->updateTest($docID[0], $updateProductDoc)) && p('1:field,old,new') && e('title,文档标题901,修改产品文档');//修改为产品文档 +r($doc->updateTest($docID[1], $updateProjectDoc)) && p('1:field,old,new') && e('module,3622,0'); //修改为项目文档 +r($doc->updateTest($docID[2], $updateExecutionDoc)) && p('2:field,old,new') && e('title,文档标题903,修改执行文档');//修改为执行文档 +r($doc->updateTest($docID[3], $updateCustomDoc)) && p('3:field,old,new') && e('keywords,关键词4,'); //修改为自定义文档 +r($doc->updateTest($docID[4], $updateUrlDoc)) && p('4:field,old,new') && e('type,text,url'); //修改为url文档 +r($doc->updateTest($docID[6], $privateDoc)) && p('6:field,old,new') && e('acl,open,private'); //修改为私有文档 +r($doc->updateTest($docID[7], $customDoc)) && p('7:field,old,new') && e('groups,1,1,2,3'); //修改为自定义文档 +r($doc->updateTest($docID[0], $noLib)) && p('0:field,old,new') && e('lib,1,'); //修改lib为空 +r($doc->updateTest($docID[0], $noTitle)) && p('title:0') && e('『文档标题』不能为空。'); //修改标题为空 +r($doc->updateTest($docID[0], $noType)) && p('2:field,old,new') && e('type,text,'); //修改type为空 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/doc/updateapilib.php b/test/model/doc/updateapilib.php new file mode 100644 index 0000000000..6fa09031a1 --- /dev/null +++ b/test/model/doc/updateapilib.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php +updateApiLib(); +cid=1 +pid=1 + +正常修改接口库 >> name,接口库,修改api文档库;baseUrl,,www.zentaopms.com;acl,private,open +修改users >> users,admin,test1 +修改名字为空 >> 『接口库名称』不能为空。 +修改成重复名称 >> 0 + +*/ +$ids = array('901', '902'); +$acl = array('', 'open', 'custom', 'private'); +$groups = array('1', '2', '3'); +$users = array('admin', 'dev1', 'dev10'); + +$openApilib = array('name' => '修改api文档库', 'baseUrl' => 'www.zentaopms.com', 'acl' => $acl[1], 'users' => 'admin', 'desc' => ''); +$updateUsers = array('users' => 'test1'); +$updateDesc = array('desc' => '修改详情'); +$noName = array('name' => ''); +$repeatName = array('name' => '修改api文档库'); + +$doc = new docTest(); + +r($doc->updateApiLibTest($ids[0], $openApilib)) && p('0:field,old,new;1:field,old,new;2:field,old,new') && e('name,接口库,修改api文档库;baseUrl,,www.zentaopms.com;acl,private,open');//正常修改接口库 +r($doc->updateApiLibTest($ids[0], $updateUsers)) && p('0:field,old,new') && e('users,admin,test1'); //修改users +r($doc->updateApiLibTest($ids[0], $noName)) && p('name:0') && e('『接口库名称』不能为空。'); //修改名字为空 +r($doc->updateApiLibTest($ids[0], $repeatName)) && p() && e('0'); //修改成重复名称 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/doc/updatelib.php b/test/model/doc/updatelib.php new file mode 100644 index 0000000000..ca022ed8f0 --- /dev/null +++ b/test/model/doc/updatelib.php @@ -0,0 +1,57 @@ +#!/usr/bin/env php +updateLib(); +cid=1 +pid=1 + +正常修改产品文档库 >> type,product,project +正常修改项目文档库 >> project,27,11 +正常修改执行文档库 >> product,0,1 +正常修改自定义文档库 >> product,17,1 +正常修改无type >> type,custom, +正常修改无产品 >> 『产品库』应当是数字。 +正常修改无项目 >> 『project』应当是数字。』 +正常修改无迭代 >> 『迭代库』应当是数字。 +正常修改无文档库名 >> 『文档库名称』不能为空。 + +*/ +$docLibIds = array('17', '117', '217'); +$type = array('product', 'project', 'execution', 'custom', ''); +$product = array('', '1'); +$project = array('', '11'); +$execution = array('', '101'); +$name = array('', '新建文档库'); +$acl = array('', 'default', 'custom'); +$groups = array('1', '2', '3'); +$users = array('admin', 'dev1', 'dev10'); + +$updateProduct = array('type' => $type[0], 'product' => $product[1], 'name' => $name[1], 'acl' => $acl[1]); +$updateProject = array('type' => $type[1], 'project' => $project[1], 'name' => $name[1], 'acl' => $acl[1]); +$updateExecution = array('type' => $type[2], 'execution' => $execution[1], 'name' => $name[1], 'acl' => $acl[1]); +$updateCustom = array('type' => $type[3], 'name' => $name[1], 'acl' => $acl[1]); +$customLib = array('type' => $type[0], 'product' => $product[1], 'name' => $name[1], 'acl' => $acl[2], 'groups' => $groups, 'users' => $users); +$noType = array('type' => $type[4], 'product' => $product[1], 'name' => $name[1], 'acl' => $acl[1]); +$noProduct = array('type' => $type[0], 'product' => $product[0], 'name' => $name[1], 'acl' => $acl[1]); +$noProject = array('type' => $type[1], 'project' => $project[0], 'name' => $name[1], 'acl' => $acl[1]); +$noExecution = array('type' => $type[2], 'execution' => $execution[0], 'name' => $name[1], 'acl' => $acl[1]); +$noName = array('type' => $type[0], 'product' => $product[1], 'name' => $name[0], 'acl' => $acl[0]); + +$doc = new docTest(); + +r($doc->updateLibTest($docLibIds[0],$updateProject)) && p('0:field,old,new') && e('type,product,project'); //正常修改产品文档库 +r($doc->updateLibTest($docLibIds[1],$updateProduct)) && p('1:field,old,new') && e('project,27,11'); //正常修改项目文档库 +r($doc->updateLibTest($docLibIds[2],$updateExecution)) && p('2:field,old,new') && e('product,0,1'); //正常修改执行文档库 +r($doc->updateLibTest($docLibIds[0],$updateCustom)) && p('1:field,old,new') && e('product,17,1'); //正常修改自定义文档库 +r($doc->updateLibTest($docLibIds[0],$noType)) && p('0:field,old,new') && e('type,custom,'); //正常修改无type +r($doc->updateLibTest($docLibIds[0],$noProduct)) && p('product:0') && e('『产品库』应当是数字。'); //正常修改无产品 +r($doc->updateLibTest($docLibIds[0],$noProject)) && p('project:0') && e('『project』应当是数字。』');//正常修改无项目 +r($doc->updateLibTest($docLibIds[0],$noExecution)) && p('execution:0') && e('『迭代库』应当是数字。'); //正常修改无迭代 +r($doc->updateLibTest($docLibIds[0],$noName)) && p('name:0') && e('『文档库名称』不能为空。'); //正常修改无文档库名 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/holiday/getholidays.php b/test/model/holiday/getholidays.php new file mode 100755 index 0000000000..393f43347e --- /dev/null +++ b/test/model/holiday/getholidays.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +getHolidays(); +cid=1 +pid=1 + +返回处于2022-3-3到2022-4-7之间的休假日期。 >> 1 +返回处于2022-3-3到2022-4-8之间的休假日期。 >> 2 +测试当结束日期大于开始日期时。 >> 0 +返回处于2022-4-7到2022-4-8之间的休假日期。 >> 2 +测试当数据库没有休假记录时。 >> 0 + +*/ + +$holiday = new holidayTest(); +$begin = array('2022-03-03', '2022-04-07'); +$end = array('2022-04-07', '2022-04-08', '2022-03-05'); + +r($holiday->getHolidaysTest($begin[0], $end[0])) && p() && e('1'); //返回处于2022-3-3到2022-4-7之间的休假日期。 +r($holiday->getHolidaysTest($begin[0], $end[1])) && p() && e('2'); //返回处于2022-3-3到2022-4-8之间的休假日期。 +r($holiday->getHolidaysTest($begin[1], $end[2])) && p() && e('0'); //测试当结束日期大于开始日期时。 +r($holiday->getHolidaysTest($begin[1], $end[1])) && p() && e('2'); //返回处于2022-4-7到2022-4-8之间的休假日期。 +r($holiday->getHolidaysTest($begin[0], $end[2])) && p() && e('0'); //测试当数据库没有休假记录时。 \ No newline at end of file diff --git a/test/model/holiday/getlist.php b/test/model/holiday/getlist.php new file mode 100755 index 0000000000..da63d18d5f --- /dev/null +++ b/test/model/holiday/getlist.php @@ -0,0 +1,35 @@ +#!/usr/bin/env php +getList(); +cid=1 +pid=1 + +返回2022年的holiday list >> 100 +返回2022年2月的holiday list >> 0 +返回2022年5月的holiday list >> 100 +返回2002年的holiday list >> 0 +返回2022年所有类型的holiday list >> 100 +返回2022年类型为holiday的holiday list >> 50 +返回2022年类型为working的holiday list >> 50 +返回2022年类型为空holiday list >> 100 + +*/ + +$holiday = new holidayTest(); +$t_numyear = array('2022', '2022-02', '2022-05', '2002', ''); +$t_type = array('all', 'holiday', 'working', ''); + +r($holiday->getListTest($t_numyear[0])) && p() && e('100'); // 返回2022年的holiday list +r($holiday->getListTest($t_numyear[1])) && p() && e('0'); // 返回2022年2月的holiday list +r($holiday->getListTest($t_numyear[2])) && p() && e('100'); // 返回2022年5月的holiday list +r($holiday->getListTest($t_numyear[3])) && p() && e('0'); // 返回2002年的holiday list +r($holiday->getListTest($t_numyear[0], $t_type[0])) && p() && e('100'); // 返回2022年所有类型的holiday list +r($holiday->getListTest($t_numyear[0], $t_type[1])) && p() && e('50'); // 返回2022年类型为holiday的holiday list +r($holiday->getListTest($t_numyear[0], $t_type[2])) && p() && e('50'); // 返回2022年类型为working的holiday list +r($holiday->getListTest($t_numyear[0], $t_type[3])) && p() && e('100'); // 返回2022年类型为空holiday list \ No newline at end of file diff --git a/test/model/holiday/getworkingdays.php b/test/model/holiday/getworkingdays.php new file mode 100755 index 0000000000..0441904cb5 --- /dev/null +++ b/test/model/holiday/getworkingdays.php @@ -0,0 +1,30 @@ +#!/usr/bin/env php +getWorkingDays(); +cid=1 +pid=1 + +返回处于2022-3-3到2022-4-6之间的工作日。 >> 0 +返回处于2022-3-3到2022-4-8之间的工作日。 >> 2 +测试当结束日期大于开始日期时。 >> 0 +返回处于2022-4-6到2022-4-8之间的工作日。 >> 2 +测试当数据库没有工作日记录时。 >> 0 + +*/ + +$holiday = new holidayTest(); + +$begin = array('2022-03-03', '2022-04-07'); +$end = array('2022-04-06', '2022-04-08', '2022-03-05'); + +r($holiday->getWorkingDaysTest($begin[0], $end[0])) && p() && e('0'); //返回处于2022-3-3到2022-4-6之间的工作日。 +r($holiday->getWorkingDaysTest($begin[0], $end[1])) && p() && e('2'); //返回处于2022-3-3到2022-4-8之间的工作日。 +r($holiday->getWorkingDaysTest($begin[1], $end[0])) && p() && e('0'); //测试当结束日期大于开始日期时。 +r($holiday->getWorkingDaysTest($begin[1], $end[1])) && p() && e('2'); //返回处于2022-4-6到2022-4-8之间的工作日。 +r($holiday->getWorkingDaysTest($begin[0], $end[2])) && p() && e('0'); //测试当数据库没有工作日记录时。 \ No newline at end of file diff --git a/test/model/holiday/isworkingday.php b/test/model/holiday/isworkingday.php new file mode 100755 index 0000000000..e58ed4f4b6 --- /dev/null +++ b/test/model/holiday/isworkingday.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +isWorkingDay(); +cid=1 +pid=1 + +测试不是工作日 >> 0 +测试是工作日 >> 1 +测试日期格式不对 >> 0 + +*/ + +$holiday = new holidayTest(); +$date = array('2022-03-01', '2022-04-09', '2002-2-2'); + +r($holiday->isWorkingDayTest($date[0])) && p() && e('0'); // 测试不是工作日 +r($holiday->isWorkingDayTest($date[1])) && p() && e('1'); // 测试是工作日 +r($holiday->isWorkingDayTest($date[2])) && p() && e('0'); // 测试日期格式不对 \ No newline at end of file diff --git a/test/model/setting/createdao.php b/test/model/setting/createdao.php new file mode 100644 index 0000000000..1e5b299bb8 --- /dev/null +++ b/test/model/setting/createdao.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +createDAO(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->createDAOTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/deleteitems.php b/test/model/setting/deleteitems.php new file mode 100644 index 0000000000..f4e098ab30 --- /dev/null +++ b/test/model/setting/deleteitems.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +deleteItems(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->deleteItemsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/getitem.php b/test/model/setting/getitem.php new file mode 100644 index 0000000000..5f225edb7e --- /dev/null +++ b/test/model/setting/getitem.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getItem(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->getItemTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/getitems.php b/test/model/setting/getitems.php new file mode 100644 index 0000000000..26a599d319 --- /dev/null +++ b/test/model/setting/getitems.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getItems(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->getItemsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/getsysandpersonalconfig.php b/test/model/setting/getsysandpersonalconfig.php new file mode 100644 index 0000000000..8342b1ed77 --- /dev/null +++ b/test/model/setting/getsysandpersonalconfig.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getSysAndPersonalConfig(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->getSysAndPersonalConfigTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/getursr.php b/test/model/setting/getursr.php new file mode 100644 index 0000000000..6a0239cf07 --- /dev/null +++ b/test/model/setting/getursr.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getURSR(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->getURSRTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/getversion.php b/test/model/setting/getversion.php new file mode 100644 index 0000000000..8c9a982342 --- /dev/null +++ b/test/model/setting/getversion.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getVersion(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->getVersionTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/parseitemparam.php b/test/model/setting/parseitemparam.php new file mode 100644 index 0000000000..a121884eb0 --- /dev/null +++ b/test/model/setting/parseitemparam.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +parseItemParam(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->parseItemParamTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/setitem.php b/test/model/setting/setitem.php new file mode 100644 index 0000000000..698edea9f0 --- /dev/null +++ b/test/model/setting/setitem.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +setItem(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->setItemTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/setitems.php b/test/model/setting/setitems.php new file mode 100644 index 0000000000..90161bb8d3 --- /dev/null +++ b/test/model/setting/setitems.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +setItems(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->setItemsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/setsn.php b/test/model/setting/setsn.php new file mode 100644 index 0000000000..2d8092362f --- /dev/null +++ b/test/model/setting/setsn.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +setSN(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->setSNTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/snneededupdate.php b/test/model/setting/snneededupdate.php new file mode 100644 index 0000000000..c1c0b73aa0 --- /dev/null +++ b/test/model/setting/snneededupdate.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +snNeededUpdate(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->snNeededUpdateTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/setting/updateversion.php b/test/model/setting/updateversion.php new file mode 100644 index 0000000000..150d77e580 --- /dev/null +++ b/test/model/setting/updateversion.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +updateVersion(); +cid=1 +pid=1 + +*/ + +$setting = new settingTest(); + +r($setting->updateVersionTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/weekly/getac.php b/test/model/weekly/getac.php old mode 100644 new mode 100755 index 2f7b99c48c..482a35417e --- a/test/model/weekly/getac.php +++ b/test/model/weekly/getac.php @@ -10,8 +10,22 @@ title=测试 weeklyModel->getAC(); cid=1 pid=1 +测试project值为0,date值为2022-05-01 >> 4191 +测试project值为0,date值为空 >> 4191 +测试project值为11,date值为2022-05-01 >> 21 +测试project值为11,date值为空 >> 21 +测试project值为41,date值为2022-05-01 >> 42 +测试project值为41,date值为空 >> 42 + */ +$projectList = array(0, 11, 41); +$dateList = array('2022-05-01', ''); $weekly = new weeklyTest(); -r($weekly->getACTest()) && p() && e(); \ No newline at end of file +r($weekly->getACTest($projectList[0], $dateList[0])) && p() && e('4191'); //测试project值为0,date值为2022-05-01 +r($weekly->getACTest($projectList[0], $dateList[1])) && p() && e('4191'); //测试project值为0,date值为空 +r($weekly->getACTest($projectList[1], $dateList[0])) && p() && e('21'); //测试project值为11,date值为2022-05-01 +r($weekly->getACTest($projectList[1], $dateList[1])) && p() && e('21'); //测试project值为11,date值为空 +r($weekly->getACTest($projectList[2], $dateList[0])) && p() && e('42'); //测试project值为41,date值为2022-05-01 +r($weekly->getACTest($projectList[2], $dateList[1])) && p() && e('42'); //测试project值为41,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getcv.php b/test/model/weekly/getcv.php old mode 100644 new mode 100755 index 035abe4d24..2a00e9f2e6 --- a/test/model/weekly/getcv.php +++ b/test/model/weekly/getcv.php @@ -10,8 +10,29 @@ title=测试 weeklyModel->getCV(); cid=1 pid=1 +测试ev值为0,ac值为0 >> 0 +测试ev值为0,ac值为10 >> -100.00 +测试ev值为0,ac值为100 >> -100.00 +测试ev值为10,ac值为0 >> 0 +测试ev值为10,ac值为10 >> 0.00 +测试ev值为10,ac值为100 >> -90.00 +测试ev值为100,ac值为0 >> 0 +测试ev值为100,ac值为10 >> 900.00 +测试ev值为100,ac值为100 >> 0.00 + */ +$evList = array(0, 10, 100); +$acList = array(0, 10, 100); + $weekly = new weeklyTest(); -r($weekly->getCVTest()) && p() && e(); \ No newline at end of file +r($weekly->getCVTest($evList[0], $acList[0])) && p() && e('0'); //测试ev值为0,ac值为0 +r($weekly->getCVTest($evList[0], $acList[1])) && p() && e('-100.00'); //测试ev值为0,ac值为10 +r($weekly->getCVTest($evList[0], $acList[2])) && p() && e('-100.00'); //测试ev值为0,ac值为100 +r($weekly->getCVTest($evList[1], $acList[0])) && p() && e('0'); //测试ev值为10,ac值为0 +r($weekly->getCVTest($evList[1], $acList[1])) && p() && e('0.00'); //测试ev值为10,ac值为10 +r($weekly->getCVTest($evList[1], $acList[2])) && p() && e('-90.00'); //测试ev值为10,ac值为100 +r($weekly->getCVTest($evList[2], $acList[0])) && p() && e('0'); //测试ev值为100,ac值为0 +r($weekly->getCVTest($evList[2], $acList[1])) && p() && e('900.00'); //测试ev值为100,ac值为10 +r($weekly->getCVTest($evList[2], $acList[2])) && p() && e('0.00'); //测试ev值为100,ac值为100 \ No newline at end of file diff --git a/test/model/weekly/getev.php b/test/model/weekly/getev.php old mode 100644 new mode 100755 index 95562a540d..b31ea7f474 --- a/test/model/weekly/getev.php +++ b/test/model/weekly/getev.php @@ -10,8 +10,22 @@ title=测试 weeklyModel->getEV(); cid=1 pid=1 +测试projectID值为0,date值为2022-05-01 >> 771.55 +测试projectID值为0,date值为空 >> 2342.78 +测试projectID值为11,date值为2022-05-01 >> 15.3 +测试projectID值为11,date值为空 >> 54.18 +测试projectID值为41,date值为2022-05-01 >> 6.91 +测试projectID值为41,date值为空 >> 19.87 + */ +$projectIDList = array(0, 11, 41); +$dateList = array('2022-05-01', ''); $weekly = new weeklyTest(); -r($weekly->getEVTest()) && p() && e(); \ No newline at end of file +r($weekly->getEVTest($projectIDList[0], $dateList[0])) && p() && e('771.55'); //测试projectID值为0,date值为2022-05-01 +r($weekly->getEVTest($projectIDList[0], $dateList[1])) && p() && e('2342.78'); //测试projectID值为0,date值为空 +r($weekly->getEVTest($projectIDList[1], $dateList[0])) && p() && e('15.3'); //测试projectID值为11,date值为2022-05-01 +r($weekly->getEVTest($projectIDList[1], $dateList[1])) && p() && e('54.18'); //测试projectID值为11,date值为空 +r($weekly->getEVTest($projectIDList[2], $dateList[0])) && p() && e('6.91'); //测试projectID值为41,date值为2022-05-01 +r($weekly->getEVTest($projectIDList[2], $dateList[1])) && p() && e('19.87'); //测试projectID值为41,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getfinished.php b/test/model/weekly/getfinished.php old mode 100644 new mode 100755 index 38c5ad07e0..f0b2463fc9 --- a/test/model/weekly/getfinished.php +++ b/test/model/weekly/getfinished.php @@ -10,8 +10,23 @@ title=测试 weeklyModel->getFinished(); cid=1 pid=1 +测试project值为0,date值为2022-05-01 >> 0 +测试project值为0,date值为空 >> 0 +测试project值为1,date值为2022-05-01 >> 0 +测试project值为1,date值为空 >> 0 +测试project值为11,date值为2022-05-01 >> 0 +测试project值为11,date值为空 >> 0 + */ +$projectList = array(0, 1, 11); +$dateList = array('2022-05-01', ''); + $weekly = new weeklyTest(); -r($weekly->getFinishedTest()) && p() && e(); \ No newline at end of file +r($weekly->getFinishedTest($projectList[0], $dateList[0])) && p() && e('0'); //测试project值为0,date值为2022-05-01 +r($weekly->getFinishedTest($projectList[0], $dateList[1])) && p() && e('0'); //测试project值为0,date值为空 +r($weekly->getFinishedTest($projectList[1], $dateList[0])) && p() && e('0'); //测试project值为1,date值为2022-05-01 +r($weekly->getFinishedTest($projectList[1], $dateList[1])) && p() && e('0'); //测试project值为1,date值为空 +r($weekly->getFinishedTest($projectList[2], $dateList[0])) && p() && e('0'); //测试project值为11,date值为2022-05-01 +r($weekly->getFinishedTest($projectList[2], $dateList[1])) && p() && e('0'); //测试project值为11,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getfromdb.php b/test/model/weekly/getfromdb.php old mode 100644 new mode 100755 index b782bf4e3a..03e54c0367 --- a/test/model/weekly/getfromdb.php +++ b/test/model/weekly/getfromdb.php @@ -10,8 +10,25 @@ title=测试 weeklyModel->getFromDB(); cid=1 pid=1 +查询项目为已挂起、日期不为空的数据 >> 1,41 +查询项目为已挂起、日期为空的数据 >> 0 +查询项目为已关闭、日期不为空的数据 >> 2,42 +查询项目为已关闭、日期为空的数据 >> 0 +查询项目为未开始、日期不为空的数据 >> 3,43 +查询项目为未开始、日期为空的数据 >> 0 +查询项目为进行中、日期不为空的数据 >> 5,45 +查询项目为金箱子、日期为空的数据 >> 0 + */ +$productID = array('41', '42', '43', '45'); +$date = array('2022-05-03', ''); $weekly = new weeklyTest(); - -r($weekly->getFromDBTest()) && p() && e(); \ No newline at end of file +r($weekly->getFromDBTest($productID[0], $date[0])) && p('id,project') && e('1,41'); //查询项目为已挂起、日期不为空的数据 +r($weekly->getFromDBTest($productID[0], $date[1])) && p() && e('0'); //查询项目为已挂起、日期为空的数据 +r($weekly->getFromDBTest($productID[1], $date[0])) && p('id,project') && e('2,42'); //查询项目为已关闭、日期不为空的数据 +r($weekly->getFromDBTest($productID[1], $date[1])) && p() && e('0'); //查询项目为已关闭、日期为空的数据 +r($weekly->getFromDBTest($productID[2], $date[0])) && p('id,project') && e('3,43'); //查询项目为未开始、日期不为空的数据 +r($weekly->getFromDBTest($productID[2], $date[1])) && p() && e('0'); //查询项目为未开始、日期为空的数据 +r($weekly->getFromDBTest($productID[3], $date[0])) && p('id,project') && e('5,45'); //查询项目为进行中、日期不为空的数据 +r($weekly->getFromDBTest($productID[3], $date[1])) && p() && e('0'); //查询项目为金箱子、日期为空的数据 \ No newline at end of file diff --git a/test/model/weekly/getlastday.php b/test/model/weekly/getlastday.php old mode 100644 new mode 100755 index bcb22f10d6..0595add63b --- a/test/model/weekly/getlastday.php +++ b/test/model/weekly/getlastday.php @@ -10,8 +10,16 @@ title=测试 weeklyModel->getLastDay(); cid=1 pid=1 +查询日期为星期日 >> 2022-05-07 +查询日期为其他 >> 2022-05-01 +查询日期为空 >> 2022-05-10 + */ +$date = array('2022-05-08', '2022-04-29', ''); + $weekly = new weeklyTest(); -r($weekly->getLastDayTest()) && p() && e(); \ No newline at end of file +r($weekly->getLastDayTest($date[0])) && p() && e('2022-05-07'); //查询日期为星期日 +r($weekly->getLastDayTest($date[1])) && p() && e('2022-05-01'); //查询日期为其他 +r($weekly->getLastDayTest($date[2])) && p() && e('2022-05-10'); //查询日期为空 \ No newline at end of file diff --git a/test/model/weekly/getpagenav.php b/test/model/weekly/getpagenav.php old mode 100644 new mode 100755 index 0c301c5f95..b61229aab8 --- a/test/model/weekly/getpagenav.php +++ b/test/model/weekly/getpagenav.php @@ -1,4 +1,4 @@ -#!/usr/bin/env php +usr/bin/env php getPageNav(); cid=1 pid=1 +查询项目为未开始,日期为当天的数据 >> 周报-项目9 +查询项目为未开始,日期为一周前的数据 >> 周报-项目9 +查询项目为进行中,日期为当天的数据 >> 周报-项目3 +查询项目为进行中,日期为一周前的数据 >> 周报-项目3 +查询项目为已挂起,日期为当天的数据 >> 周报-项目7 +查询项目为已挂起,日期为一周前的数据 >> 周报-项目7 +查询项目为已关闭,日期为当天的数据 >> 周报-项目8 +查询项目为已关闭,日期为一周前的数据 >> 周报-项目8 + */ +$productID = array('19', '13', '17', '18'); +$date = array('2022-05-07', ''); $weekly = new weeklyTest(); - -r($weekly->getPageNavTest()) && p() && e(); \ No newline at end of file +r($weekly->getPageNavTest($productID[0], $date[0])) && p() && e('周报-项目9'); //查询项目为未开始,日期为当天的数据 +r($weekly->getPageNavTest($productID[0], $date[1])) && p() && e('周报-项目9'); //查询项目为未开始,日期为一周前的数据 +r($weekly->getPageNavTest($productID[1], $date[0])) && p() && e('周报-项目3'); //查询项目为进行中,日期为当天的数据 +r($weekly->getPageNavTest($productID[1], $date[1])) && p() && e('周报-项目3'); //查询项目为进行中,日期为一周前的数据 +r($weekly->getPageNavTest($productID[2], $date[0])) && p() && e('周报-项目7'); //查询项目为已挂起,日期为当天的数据 +r($weekly->getPageNavTest($productID[2], $date[1])) && p() && e('周报-项目7'); //查询项目为已挂起,日期为一周前的数据 +r($weekly->getPageNavTest($productID[3], $date[0])) && p() && e('周报-项目8'); //查询项目为已关闭,日期为当天的数据 +r($weekly->getPageNavTest($productID[3], $date[1])) && p() && e('周报-项目8'); //查询项目为已关闭,日期为一周前的数据 diff --git a/test/model/weekly/getplanedtaskbyweek.php b/test/model/weekly/getplanedtaskbyweek.php old mode 100644 new mode 100755 index 68290e3cc0..3b232e2a96 --- a/test/model/weekly/getplanedtaskbyweek.php +++ b/test/model/weekly/getplanedtaskbyweek.php @@ -10,8 +10,22 @@ title=测试 weeklyModel->getPlanedTaskByWeek(); cid=1 pid=1 +测试project值为0,date值为2022-05-01 >> 子任务5 +测试project值为0,date值为空 >> 开发任务610 +测试project值为1,date值为2022-05-01 >> 0 +测试project值为1,date值为空 >> 0 +测试project值为11,date值为2022-05-01 >> 开发任务11 +测试project值为11,date值为空 >> 开发任务11 + */ +$projectList = array(0, 1, 11); +$dateList = array('2022-05-01', ''); $weekly = new weeklyTest(); -r($weekly->getPlanedTaskByWeekTest()) && p() && e(); \ No newline at end of file +r($weekly->getPlanedTaskByWeekTest($projectList[0], $dateList[0])) && p('905:name') && e('子任务5'); //测试project值为0,date值为2022-05-01 +r($weekly->getPlanedTaskByWeekTest($projectList[0], $dateList[1])) && p('600:name') && e('开发任务610'); //测试project值为0,date值为空 +r($weekly->getPlanedTaskByWeekTest($projectList[1], $dateList[0])) && p() && e('0'); //测试project值为1,date值为2022-05-01 +r($weekly->getPlanedTaskByWeekTest($projectList[1], $dateList[1])) && p() && e('0'); //测试project值为1,date值为空 +r($weekly->getPlanedTaskByWeekTest($projectList[2], $dateList[0])) && p('1:name') && e('开发任务11'); //测试project值为11,date值为2022-05-01 +r($weekly->getPlanedTaskByWeekTest($projectList[2], $dateList[1])) && p('1:name') && e('开发任务11'); //测试project值为11,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getpostponed.php b/test/model/weekly/getpostponed.php old mode 100644 new mode 100755 index acaf88a500..e160a85f5e --- a/test/model/weekly/getpostponed.php +++ b/test/model/weekly/getpostponed.php @@ -10,8 +10,22 @@ title=测试 weeklyModel->getPostponed(); cid=1 pid=1 +测试project值为0,date值为2022-05-01 >> 子任务4 +测试project值为0,date值为空 >> 开发任务608 +测试project值为1,date值为2022-05-01 >> 0 +测试project值为1,date值为空 >> 0 +测试project值为11,date值为2022-05-01 >> 开发任务101 +测试project值为11,date值为空 >> 开发任务461 + */ +$projectList = array(0, 1, 11); +$dateList = array('2022-05-01', ''); $weekly = new weeklyTest(); -r($weekly->getPostponedTest()) && p() && e(); \ No newline at end of file +r($weekly->getPostponedTest($projectList[0], $dateList[0])) && p('92:name') && e('子任务4'); //测试project值为0,date值为2022-05-01 +r($weekly->getPostponedTest($projectList[0], $dateList[1])) && p('56:name') && e('开发任务608'); //测试project值为0,date值为空 +r($weekly->getPostponedTest($projectList[1], $dateList[0])) && p() && e('0'); //测试project值为1,date值为2022-05-01 +r($weekly->getPostponedTest($projectList[1], $dateList[1])) && p() && e('0'); //测试project值为1,date值为空 +r($weekly->getPostponedTest($projectList[2], $dateList[0])) && p('5:name') && e('开发任务101'); //测试project值为11,date值为2022-05-01 +r($weekly->getPostponedTest($projectList[2], $dateList[1])) && p('1:name') && e('开发任务461'); //测试project值为11,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getpv.php b/test/model/weekly/getpv.php old mode 100644 new mode 100755 index 3fd279a9a6..b5832f0757 --- a/test/model/weekly/getpv.php +++ b/test/model/weekly/getpv.php @@ -10,8 +10,23 @@ title=测试 weeklyModel->getPV(); cid=1 pid=1 +测试projectID值为0,date值为2022-05-01 >> 1488 +测试projectID值为0,date值为空 >> 4223.02 +测试projectID值为11,date值为2022-05-01 >> 24 +测试projectID值为11,date值为空 >> 100 +测试projectID值为41,date值为2022-05-01 >> 9 +测试projectID值为41,date值为空 >> 50.5 + */ +$projectIDList = array(0, 11, 41); +$dateList = array('2022-05-01', ''); + $weekly = new weeklyTest(); -r($weekly->getPVTest()) && p() && e(); \ No newline at end of file +r($weekly->getPVTest($projectIDList[0], $dateList[0])) && p() && e('1488'); //测试projectID值为0,date值为2022-05-01 +r($weekly->getPVTest($projectIDList[0], $dateList[1])) && p() && e('4223.02'); //测试projectID值为0,date值为空 +r($weekly->getPVTest($projectIDList[1], $dateList[0])) && p() && e('24'); //测试projectID值为11,date值为2022-05-01 +r($weekly->getPVTest($projectIDList[1], $dateList[1])) && p() && e('100'); //测试projectID值为11,date值为空 +r($weekly->getPVTest($projectIDList[2], $dateList[0])) && p() && e('9'); //测试projectID值为41,date值为2022-05-01 +r($weekly->getPVTest($projectIDList[2], $dateList[1])) && p() && e('50.5'); //测试projectID值为41,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getstaff.php b/test/model/weekly/getstaff.php old mode 100644 new mode 100755 index e601f180a2..0f18b7ff56 --- a/test/model/weekly/getstaff.php +++ b/test/model/weekly/getstaff.php @@ -10,8 +10,23 @@ title=测试 weeklyModel->getStaff(); cid=1 pid=1 +测试project值为0,date值为2022-05-01 >> 0 +测试project值为0,date值为空 >> 0 +测试project值为1,date值为2022-05-01 >> 0 +测试project值为1,date值为空 >> 0 +测试project值为11,date值为2022-05-01 >> 0 +测试project值为11,date值为空 >> 0 + */ +$projectList = array(0, 1, 11); +$dateList = array('2022-05-01', ''); + $weekly = new weeklyTest(); -r($weekly->getStaffTest()) && p() && e(); \ No newline at end of file +r($weekly->getStaffTest($projectList[0], $dateList[0])) && p() && e('0'); //测试project值为0,date值为2022-05-01 +r($weekly->getStaffTest($projectList[0], $dateList[1])) && p() && e('0'); //测试project值为0,date值为空 +r($weekly->getStaffTest($projectList[1], $dateList[0])) && p() && e('0'); //测试project值为1,date值为2022-05-01 +r($weekly->getStaffTest($projectList[1], $dateList[1])) && p() && e('0'); //测试project值为1,date值为空 +r($weekly->getStaffTest($projectList[2], $dateList[0])) && p() && e('0'); //测试project值为11,date值为2022-05-01 +r($weekly->getStaffTest($projectList[2], $dateList[1])) && p() && e('0'); //测试project值为11,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getsv.php b/test/model/weekly/getsv.php old mode 100644 new mode 100755 index 937ef27cd8..f29de94def --- a/test/model/weekly/getsv.php +++ b/test/model/weekly/getsv.php @@ -10,8 +10,28 @@ title=测试 weeklyModel->getSV(); cid=1 pid=1 +测试ev值为0,pv值为0 >> 0 +测试ev值为0,pv值为10 >> -100.00 +测试ev值为0,pv值为100 >> -100.00 +测试ev值为10,pv值为0 >> 0 +测试ev值为10,pv值为10 >> 0.00 +测试ev值为10,pv值为100 >> -90.00 +测试ev值为100,pv值为0 >> 0 +测试ev值为100,pv值为10 >> 900.00 +测试ev值为100,pv值为100 >> 0.00 + */ +$evList = array(0, 10, 100); +$pvList = array(0, 10, 100); $weekly = new weeklyTest(); -r($weekly->getSVTest()) && p() && e(); \ No newline at end of file +r($weekly->getSVTest($evList[0], $pvList[0])) && p() && e('0'); //测试ev值为0,pv值为0 +r($weekly->getSVTest($evList[0], $pvList[1])) && p() && e('-100.00'); //测试ev值为0,pv值为10 +r($weekly->getSVTest($evList[0], $pvList[2])) && p() && e('-100.00'); //测试ev值为0,pv值为100 +r($weekly->getSVTest($evList[1], $pvList[0])) && p() && e('0'); //测试ev值为10,pv值为0 +r($weekly->getSVTest($evList[1], $pvList[1])) && p() && e('0.00'); //测试ev值为10,pv值为10 +r($weekly->getSVTest($evList[1], $pvList[2])) && p() && e('-90.00'); //测试ev值为10,pv值为100 +r($weekly->getSVTest($evList[2], $pvList[0])) && p() && e('0'); //测试ev值为100,pv值为0 +r($weekly->getSVTest($evList[2], $pvList[1])) && p() && e('900.00'); //测试ev值为100,pv值为10 +r($weekly->getSVTest($evList[2], $pvList[2])) && p() && e('0.00'); //测试ev值为100,pv值为100 \ No newline at end of file diff --git a/test/model/weekly/gettasksofnextweek.php b/test/model/weekly/gettasksofnextweek.php old mode 100644 new mode 100755 index 9be0e830df..8ce28e9b19 --- a/test/model/weekly/gettasksofnextweek.php +++ b/test/model/weekly/gettasksofnextweek.php @@ -10,8 +10,23 @@ title=测试 weeklyModel->getTasksOfNextWeek(); cid=1 pid=1 +测试project值为0,date值为2022-05-01 >> 子任务10 +测试project值为0,date值为空 >> 开发任务606 +测试project值为1,date值为2022-05-01 >> 0 +测试project值为1,date值为空 >> 0 +测试project值为11,date值为2022-05-01 >> 开发任务551 +测试project值为11,date值为空 >> 开发任务11 + */ +$projectList = array(0, 1, 11); +$dateList = array('2022-05-01', ''); + $weekly = new weeklyTest(); -r($weekly->getTasksOfNextWeekTest()) && p() && e(); \ No newline at end of file +r($weekly->getTasksOfNextWeekTest($projectList[0], $dateList[0])) && p('910:name') && e('子任务10'); //测试project值为0,date值为2022-05-01 +r($weekly->getTasksOfNextWeekTest($projectList[0], $dateList[1])) && p('596:name') && e('开发任务606'); //测试project值为0,date值为空 +r($weekly->getTasksOfNextWeekTest($projectList[1], $dateList[0])) && p() && e('0'); //测试project值为1,date值为2022-05-01 +r($weekly->getTasksOfNextWeekTest($projectList[1], $dateList[1])) && p() && e('0'); //测试project值为1,date值为空 +r($weekly->getTasksOfNextWeekTest($projectList[2], $dateList[0])) && p('541:name') && e('开发任务551'); //测试project值为11,date值为2022-05-01 +r($weekly->getTasksOfNextWeekTest($projectList[2], $dateList[1])) && p('1:name') && e('开发任务11'); //测试project值为11,date值为空 \ No newline at end of file diff --git a/test/model/weekly/getthismonday.php b/test/model/weekly/getthismonday.php old mode 100644 new mode 100755 index f622ac65b2..07a4de5dcb --- a/test/model/weekly/getthismonday.php +++ b/test/model/weekly/getthismonday.php @@ -10,8 +10,15 @@ title=测试 weeklyModel->getThisMonday(); cid=1 pid=1 +查询日期为星期日 >> 2022-05-02 +查询日期为其他 >> 2022-04-25 +查询日期为空 >> 2022-05-04 + */ +$date = array('2022-05-08', '2022-04-29', ''); $weekly = new weeklyTest(); -r($weekly->getThisMondayTest()) && p() && e(); \ No newline at end of file +r($weekly->getThisMondayTest($date[0])) && p() && e('2022-05-02'); //查询日期为星期日 +r($weekly->getThisMondayTest($date[1])) && p() && e('2022-04-25'); //查询日期为其他 +r($weekly->getThisMondayTest($date[2])) && p() && e('2022-05-04'); //查询日期为空 \ No newline at end of file diff --git a/test/model/weekly/getthissunday.php b/test/model/weekly/getthissunday.php old mode 100644 new mode 100755 index 30182dd1cb..e3f4b574e5 --- a/test/model/weekly/getthissunday.php +++ b/test/model/weekly/getthissunday.php @@ -10,8 +10,15 @@ title=测试 weeklyModel->getThisSunday(); cid=1 pid=1 +查询日期为星期日 >> 2022-05-08 +查询日期为其他 >> 2022-05-01 +查询日期为空 >> 2022-05-10 + */ +$date = array('2022-05-08', '2022-04-29', ''); $weekly = new weeklyTest(); -r($weekly->getThisSundayTest()) && p() && e(); \ No newline at end of file +r($weekly->getThisSundayTest($date[0])) && p() && e('2022-05-08'); //查询日期为星期日 +r($weekly->getThisSundayTest($date[1])) && p() && e('2022-05-01'); //查询日期为其他 +r($weekly->getThisSundayTest($date[2])) && p() && e('2022-05-10'); //查询日期为空 \ No newline at end of file diff --git a/test/model/weekly/gettips.php b/test/model/weekly/gettips.php old mode 100644 new mode 100755 index fc660a2274..3eb2fb95f7 --- a/test/model/weekly/gettips.php +++ b/test/model/weekly/gettips.php @@ -10,8 +10,22 @@ title=测试 weeklyModel->getTips(); cid=1 pid=1 +测试type值为progress,data值为0 >> 0 +测试type值为progress,data值为1 >> 0 +测试type值为cost,data值为0 >> 0 +测试type值为cost,data值为1 >> 0 +测试type值为空,data值为0 >> 0 +测试type值为空,data值为1 >> 0 + */ +$typeList = array('progress', 'cost', ''); +$dataList = array(0, 1); $weekly = new weeklyTest(); -r($weekly->getTipsTest()) && p() && e(); \ No newline at end of file +r($weekly->getTipsTest($typeList[0], $dataList[0])) && p() && e('0'); //测试type值为progress,data值为0 +r($weekly->getTipsTest($typeList[0], $dataList[1])) && p() && e('0'); //测试type值为progress,data值为1 +r($weekly->getTipsTest($typeList[1], $dataList[0])) && p() && e('0'); //测试type值为cost,data值为0 +r($weekly->getTipsTest($typeList[1], $dataList[1])) && p() && e('0'); //测试type值为cost,data值为1 +r($weekly->getTipsTest($typeList[2], $dataList[0])) && p() && e('0'); //测试type值为空,data值为0 +r($weekly->getTipsTest($typeList[2], $dataList[1])) && p() && e('0'); //测试type值为空,data值为1 \ No newline at end of file diff --git a/test/model/weekly/getweekpairs.php b/test/model/weekly/getweekpairs.php old mode 100644 new mode 100755 index 0ddaeca4c9..38a1b6dbb4 --- a/test/model/weekly/getweekpairs.php +++ b/test/model/weekly/getweekpairs.php @@ -10,8 +10,39 @@ title=测试 weeklyModel->getWeekPairs(); cid=1 pid=1 + >> 0 + >> 0 + >> 0 + >> 0 + >> 第 1 周( 2022-04-25 ~ 2022-05-01) + >> 0 + >> 0 + >> 0 + >> 0 + >> 第 1 周( 2022-05-03 ~ 2022-05-09) + >> 第 4 周( 2022-05-23 ~ 2022-05-29) + >> 第 239 周( 2026-11-23 ~ 2026-11-29) + >> 第 5 周( 2022-05-30 ~ 2022-06-05) + */ +$begin = array(1, 2, 3, ''); +$end = array(1, 2, 3, ''); $weekly = new weeklyTest(); -r($weekly->getWeekPairsTest()) && p() && e(); \ No newline at end of file +r($weekly->getWeekPairsTest($begin[0], $end[0])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[0], $end[1])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[0], $end[2])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[0], $end[3])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[1], $end[0])) && p() && e(); +r($weekly->getWeekPairsTest($begin[1], $end[1])) && p() && e(); +r($weekly->getWeekPairsTest($begin[1], $end[2])) && p() && e(); +r($weekly->getWeekPairsTest($begin[1], $end[3])) && p('20220425') && e('第 1 周( 2022-04-25 ~ 2022-05-01)'); +r($weekly->getWeekPairsTest($begin[2], $end[0])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[2], $end[1])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[2], $end[2])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[2], $end[3])) && p() && e('0'); +r($weekly->getWeekPairsTest($begin[3], $end[0])) && p('20220503') && e('第 1 周( 2022-05-03 ~ 2022-05-09)'); +r($weekly->getWeekPairsTest($begin[3], $end[1])) && p('20220523') && e('第 4 周( 2022-05-23 ~ 2022-05-29)'); +r($weekly->getWeekPairsTest($begin[3], $end[2])) && p('20261123') && e('第 239 周( 2026-11-23 ~ 2026-11-29)'); +r($weekly->getWeekPairsTest($begin[3], $end[3])) && p('20220530') && e('第 5 周( 2022-05-30 ~ 2022-06-05)'); \ No newline at end of file diff --git a/test/model/weekly/getweeksn.php b/test/model/weekly/getweeksn.php old mode 100644 new mode 100755 index 2ab539e49e..456289c5c0 --- a/test/model/weekly/getweeksn.php +++ b/test/model/weekly/getweeksn.php @@ -10,8 +10,18 @@ title=测试 weeklyModel->getWeekSN(); cid=1 pid=1 +开始时间和结束时间都不为空 >> 1 +开始时间不为空,结束时间为空 >> -2730 +开始时间为空,结束时间不为空 >> 2732 +开始时间和结束时间都为空 >> 0 + */ +$begin = array('2022-05-02', ''); +$end = array('2022-05-06', ''); $weekly = new weeklyTest(); -r($weekly->getWeekSNTest()) && p() && e(); \ No newline at end of file +r($weekly->getWeekSNTest($begin[0], $end[0])) && p() && e('1'); //开始时间和结束时间都不为空 +r($weekly->getWeekSNTest($begin[0], $end[1])) && p() && e('-2730'); //开始时间不为空,结束时间为空 +r($weekly->getWeekSNTest($begin[1], $end[0])) && p() && e('2732'); //开始时间为空,结束时间不为空 +r($weekly->getWeekSNTest($begin[1], $end[1])) && p() && e('0'); //开始时间和结束时间都为空 \ No newline at end of file diff --git a/test/model/weekly/getworkloadbytype.php b/test/model/weekly/getworkloadbytype.php old mode 100644 new mode 100755 index 945f598ffc..cfc1063ea9 --- a/test/model/weekly/getworkloadbytype.php +++ b/test/model/weekly/getworkloadbytype.php @@ -10,8 +10,17 @@ title=测试 weeklyModel->getWorkloadByType(); cid=1 pid=1 +测试project值为0 >> 574.00,568.00,563.00,556.00,557.00,571.00,563.00,566.00 +测试project值为1 >> 0 +测试project值为11 >> 24.00,11.00,16.00,3.00,9.00,5.00,18.00,14.00 +测试project值为41 >> 13.00,12.00,3.00,7.00 + */ +$projectList = array(0, 1, 11, 41); $weekly = new weeklyTest(); -r($weekly->getWorkloadByTypeTest()) && p() && e(); \ No newline at end of file +r($weekly->getWorkloadByTypeTest($projectList[0])) && p('design,devel,test,study,discuss,ui,affair,misc') && e('574.00,568.00,563.00,556.00,557.00,571.00,563.00,566.00'); //测试project值为0 +r($weekly->getWorkloadByTypeTest($projectList[1])) && p() && e('0'); //测试project值为1 +r($weekly->getWorkloadByTypeTest($projectList[2])) && p('design,devel,test,study,discuss,ui,affair,misc') && e('24.00,11.00,16.00,3.00,9.00,5.00,18.00,14.00'); //测试project值为11 +r($weekly->getWorkloadByTypeTest($projectList[3])) && p('affair,test,study,discuss') && e('13.00,12.00,3.00,7.00'); //测试project值为41 \ No newline at end of file diff --git a/test/model/weekly/save.php b/test/model/weekly/save.php old mode 100644 new mode 100755 index 751897ec2f..7816a6cfa6 --- a/test/model/weekly/save.php +++ b/test/model/weekly/save.php @@ -10,8 +10,27 @@ title=测试 weeklyModel->save(); cid=1 pid=1 +保存项目为已挂起、日期不为空的数据 >> 11,41 +保存项目为已挂起、日期为空的数据 >> 12,41 +保存项目为已关闭、日期不为空的数据 >> 13,42 +保存项目为已关闭、日期为空的数据 >> 14,42 +保存项目为未开始、日期不为空的数据 >> 15,43 +保存项目为未开始、日期为空的数据 >> 16,43 +保存项目为进行中、日期不为空的数据 >> 17,45 +保存项目为进行中、日期为空的数据 >> 18,45 + */ +$productID = array('41', '42', '43', '45'); +$date = array('2022-04-29', ''); $weekly = new weeklyTest(); +r($weekly->saveTest($productID[0], $date[0])) && p('id,project') && e('11,41'); //保存项目为已挂起、日期不为空的数据 +r($weekly->saveTest($productID[0], $date[1])) && p('id,project') && e('12,41'); //保存项目为已挂起、日期为空的数据 +r($weekly->saveTest($productID[1], $date[0])) && p('id,project') && e('13,42'); //保存项目为已关闭、日期不为空的数据 +r($weekly->saveTest($productID[1], $date[1])) && p('id,project') && e('14,42'); //保存项目为已关闭、日期为空的数据 +r($weekly->saveTest($productID[2], $date[0])) && p('id,project') && e('15,43'); //保存项目为未开始、日期不为空的数据 +r($weekly->saveTest($productID[2], $date[1])) && p('id,project') && e('16,43'); //保存项目为未开始、日期为空的数据 +r($weekly->saveTest($productID[3], $date[0])) && p('id,project') && e('17,45'); //保存项目为进行中、日期不为空的数据 +r($weekly->saveTest($productID[3], $date[1])) && p('id,project') && e('18,45'); //保存项目为进行中、日期为空的数据 -r($weekly->saveTest()) && p() && e(); \ No newline at end of file +system("./ztest init"); \ No newline at end of file diff --git a/test/ztest b/test/ztest index e4b227b9a3..97668cbd7e 100755 --- a/test/ztest +++ b/test/ztest @@ -91,11 +91,16 @@ switch($argv[1]) case 'project': ztfRun('model/project'); break; + case 'holiday': + ztfRun('model/holiday'); + break; case 'report': ztfRun('model/report'); break; case 'sso': ztfRun('model/sso'); + case 'setting': + ztfRun('model/setting'); break; case 'stage': ztfRun('model/stage');