Merge branch feature/workflowgroup of zentao/zentaopms (#12527)
This commit is contained in:
@@ -1,32 +1,5 @@
|
||||
action,model,printAction
|
||||
action,model,renderAction
|
||||
admin,model,checkPrivMenu
|
||||
admin,model,getSecretKey
|
||||
ai,model,getDefaultLanguageModel
|
||||
ai,model,toggleModel
|
||||
bi,model,downloadFile
|
||||
bi,model,getCorrectGroup
|
||||
bi,model,getTableFields
|
||||
bi,model,initParquet
|
||||
bi,model,prepareBuiltinChartSQL
|
||||
bi,model,prepareColumns
|
||||
bi,model,prepareFieldObjects
|
||||
bi,model,sql2Statement
|
||||
block,model,getModelType4Projects
|
||||
模块,类,函数名
|
||||
branch,model,manage
|
||||
bug,model,getDatatableModules
|
||||
bug,model,getLinkedCommits
|
||||
bug,model,updateLinkedCommits
|
||||
build,model,addReleaseLabelForBuilds
|
||||
caselib,model,getPairs
|
||||
chart,model,addFormatter4Echart
|
||||
chart,model,addRotate4Echart
|
||||
chart,model,checkAccess
|
||||
chart,model,genCluBar
|
||||
chart,model,genLineChart
|
||||
chart,model,genPie
|
||||
chart,model,genRadar
|
||||
chart,model,genWaterpolo
|
||||
cne,model,apiGet
|
||||
cne,model,apiPost
|
||||
cne,model,backup
|
||||
@@ -42,98 +15,35 @@ cne,model,restore
|
||||
cne,model,translateError
|
||||
cne,model,uploadCert
|
||||
cne,model,validateCert
|
||||
common,model,apiError
|
||||
common,model,buildOperateMenu
|
||||
common,model,checkEntry
|
||||
common,model,checkSafeFile
|
||||
common,model,formConfig
|
||||
common,model,printBack
|
||||
common,model,printDuration
|
||||
common,model,printPreAndNext
|
||||
common,model,processMarkdown
|
||||
convert,model,getVersionGroup
|
||||
convert,model,getZentaoFields
|
||||
convert,model,getZentaoObjectList
|
||||
convert,model,getZentaoRelationList
|
||||
doc,model,getDocTemplateSpaces
|
||||
epic,model,getToAndCcList
|
||||
host,model,processtreeMap
|
||||
convert,model,saveState
|
||||
instance,model,installationSettingsMap
|
||||
instance,model,stop
|
||||
metric,model,checkHasInferenceOfDate
|
||||
metric,model,getDateByDateType
|
||||
metric,model,getLatestResultByCode
|
||||
metric,model,updateMetricFields
|
||||
pivot,model,addDrillFields
|
||||
pivot,model,getMaxVersion
|
||||
pivot,model,switchNewVersion
|
||||
product,model,buildSearchConfig
|
||||
program,model,checkPriv
|
||||
project,model,getExecutionProductGroup
|
||||
release,model,deleteRelated
|
||||
report,model,getContributionCountTips
|
||||
report,model,getUserYearContributionCount
|
||||
screen,model,genNotFoundOrDraftComponentOption
|
||||
screen,model,getActiveProductCard
|
||||
screen,model,getThumbnail
|
||||
screen,model,getUsageReportProjects
|
||||
screen,model,preparePaginationBeforeFetchRecords
|
||||
search,model,buildOldQuery
|
||||
search,model,getOldQuery
|
||||
search,model,processSearchParams
|
||||
task,model,updateParent
|
||||
testcase,model,processDatas
|
||||
testcase,model,saveXmindImport
|
||||
todo,model,dateRange
|
||||
tutorial,model,getColumn
|
||||
user,model,getManageListGroupByType
|
||||
user,model,mergeAclsToUserView
|
||||
weekly,model,getLeft
|
||||
zanode,model,runZTFScript
|
||||
transfer,model,format
|
||||
action,tao,processCreateChildrenActionExtra
|
||||
action,tao,processcreatechilrenactionextra
|
||||
action,tao,processCreateRequirementsActionExtra
|
||||
action,tao,processLinkStoryAndBugActionExtra
|
||||
action,tao,processToStoryActionExtra
|
||||
bi,tao,fetchActionDate
|
||||
bi,tao,fetchAllTables
|
||||
convert,tao,createDefaultExecution
|
||||
convert,tao,createDefaultLayout
|
||||
convert,tao,createProject
|
||||
convert,tao,createTicket
|
||||
convert,tao,createWorkflowField
|
||||
convert,tao,createWorkflowStatus
|
||||
convert,tao,importJiraIssue
|
||||
convert,tao,createTask
|
||||
convert,tao,processJiraContent
|
||||
convert,tao,processWorkflowHooks
|
||||
kanban,tao,getBranchesForPlanKanban
|
||||
kanban,tao,getStoryCardMenu
|
||||
kanban,tao,getstrorycardmenu
|
||||
kanban,tao,refreshBugCards
|
||||
kanban,tao,refreshERURCards
|
||||
kanban,tao,refreshStoryCards
|
||||
kanban,tao,updateCardAssignedTo
|
||||
metric,tao,getObjectsWithPager
|
||||
pivot,tao,fetchPivot
|
||||
pivot,tao,fetchPivotDrills
|
||||
pivot,tao,getBugGroup
|
||||
pivot,tao,getExecutionList
|
||||
pivot,tao,getPlanStatusStatistics
|
||||
pivot,tao,getProductProjects
|
||||
pivot,tao,processProductPlan
|
||||
project,tao,buildLinkForBug
|
||||
project,tao,buildLinkForProject
|
||||
project,tao,buildLinkForStory
|
||||
search,tao,appendFiles
|
||||
search,tao,checkDocPriv
|
||||
search,tao,checkExecutionPriv
|
||||
search,tao,checkFeedbackAndTicketPriv
|
||||
search,tao,checkObjectPriv
|
||||
search,tao,checkPriv
|
||||
search,tao,checkProductPriv
|
||||
search,tao,checkProgramPriv
|
||||
search,tao,checkProjectPriv
|
||||
search,tao,checkRelatedObjectPriv
|
||||
search,tao,checkTestsuitePriv
|
||||
search,tao,checkTodoPriv
|
||||
search,tao,processDocRecord
|
||||
search,tao,processExecutionRecord
|
||||
search,tao,processProjectRecord
|
||||
@@ -141,574 +51,107 @@ search,tao,processRecord
|
||||
search,tao,processRiskRecord
|
||||
search,tao,processStoryRecord
|
||||
search,tao,processTaskRecord
|
||||
search,tao,unify
|
||||
story,tao,doSaveUploadImage
|
||||
story,tao,getChildItems
|
||||
story,tao,getProductReviewers
|
||||
task,tao,formatDatetime
|
||||
admin,zen,certifyByAPI
|
||||
admin,zen,fetchAPI
|
||||
admin,zen,getZentaoData
|
||||
admin,zen,sendCodeByAPI
|
||||
admin,zen,setCompanyByAPI
|
||||
admin,zen,syncDynamics
|
||||
admin,zen,syncExtensions
|
||||
admin,zen,syncPublicClasses
|
||||
api,zen,generateLibsDropMenu
|
||||
api,zen,getMethod
|
||||
backup,zen,backupCode
|
||||
backup,zen,backupFile
|
||||
backup,zen,backupSQL
|
||||
backup,zen,getBackupList
|
||||
backup,zen,removeExpiredFiles
|
||||
backup,zen,restoreFile
|
||||
backup,zen,restoreSQL
|
||||
backup,zen,setHoldDays
|
||||
block,zen,createMoreLink
|
||||
block,zen,printAnnualWorkloadBlock
|
||||
block,zen,printAssignToMeBlock
|
||||
block,zen,printBugBlock
|
||||
block,zen,printBugStatisticBlock
|
||||
block,zen,printBuildBlock
|
||||
block,zen,printCaseBlock
|
||||
block,zen,printDocCollectListBlock
|
||||
block,zen,printDocDynamicBlock
|
||||
block,zen,printDocMyCollectionBlock
|
||||
block,zen,printDocMyCreatedBlock
|
||||
block,zen,printDocRecentUpdateBlock
|
||||
block,zen,printDocViewListBlock
|
||||
block,zen,printExecutionListBlock
|
||||
block,zen,printExecutionStatisticBlock
|
||||
block,zen,printGuideBlock
|
||||
block,zen,printIssueBlock
|
||||
block,zen,printMonthlyProgressBlock
|
||||
block,zen,printPlanBlock
|
||||
block,zen,printProductDocBlock
|
||||
block,zen,printProductListBlock
|
||||
block,zen,printProductStatisticBlock
|
||||
block,zen,printProjectOverviewBlock
|
||||
block,zen,printProjectStatisticBlock
|
||||
block,zen,printRiskBlock
|
||||
block,zen,printscrumiessueblock
|
||||
block,zen,printScrumIssueBlock
|
||||
block,zen,printScrumListBlock
|
||||
block,zen,printScrumOverviewBlock
|
||||
block,zen,printScrumProductBlock
|
||||
block,zen,printScrumRiskBlock
|
||||
block,zen,printScrumRoadMapBlock
|
||||
block,zen,printScrumTestBlock
|
||||
block,zen,printSingleBugStatisticBlock
|
||||
block,zen,printSingleDynamicBlock
|
||||
block,zen,printsinglemonthlyprogessblock
|
||||
block,zen,printSingleMonthlyProgressBlock
|
||||
block,zen,printSinglePlanBlock
|
||||
block,zen,printSingleReleaseBlock
|
||||
block,zen,printSingleStatisticBlock
|
||||
block,zen,printSingleStoryBlock
|
||||
block,zen,printSprintBlock
|
||||
block,zen,printStoryBlock
|
||||
block,zen,printTaskBlock
|
||||
block,zen,printTeamAchievementBlock
|
||||
block,zen,printTesttaskBlock
|
||||
block,zen,printWaterfallEstimateBlock
|
||||
block,zen,printWaterfallGeneralReportBlock
|
||||
block,zen,printWaterfallIssueBlock
|
||||
block,zen,printWaterfallProgressBlock
|
||||
block,zen,printWaterfallRiskBlock
|
||||
block,zen,processBlockForRender
|
||||
bug,zen,afterBatchCreate
|
||||
bug,zen,afterCreate
|
||||
bug,zen,afterUpdate
|
||||
bug,zen,assignBatchCreateVars
|
||||
bug,zen,assignBatchEditVars
|
||||
bug,zen,assignKanbanVars
|
||||
bug,zen,assignProductRelatedVars
|
||||
bug,zen,assignProjectRelatedVars
|
||||
bug,zen,assignUsersForBatchEdit
|
||||
bug,zen,assignusersforebatchedit
|
||||
bug,zen,assignVarsForBatchCreate
|
||||
bug,zen,assignVarsForEdit
|
||||
bug,zen,buildBrowseView
|
||||
bug,zen,buildBugForResolve
|
||||
bug,zen,buildBugsForBatchCreate
|
||||
bug,zen,buildBugsForBatchEdit
|
||||
bug,zen,buildCreateForm
|
||||
bug,zen,buildEditForm
|
||||
bug,zen,buildSearchFormForLinkBugs
|
||||
bug,zen,checkRquiredForEdit
|
||||
bug,zen,extractObjectFromExtras
|
||||
bug,zen,getAssignedToPairs
|
||||
bug,zen,getBatchResolveVars
|
||||
bug,zen,getBranchesForCreate
|
||||
bug,zen,getBrowseBugs
|
||||
bug,zen,getBuildsForCreate
|
||||
bug,zen,getExecutionsForCreate
|
||||
bug,zen,getExportFileName
|
||||
bug,zen,getModulesForCreate
|
||||
bug,zen,getProductMembersForCreate
|
||||
bug,zen,getBranchOptions
|
||||
bug,zen,getProductsForCreate
|
||||
bug,zen,getProjectsForCreate
|
||||
bug,zen,getStoriesForCreate
|
||||
bug,zen,getTasksForCreate
|
||||
bug,zen,initBug
|
||||
bug,zen,mergeChartOption
|
||||
bug,zen,operateAfterBatchEdit
|
||||
bug,zen,prepareBrowseParams
|
||||
bug,zen,processImageForBatchCreate
|
||||
bug,zen,responseAfterBatchCreate
|
||||
bug,zen,responseAfterBatchEdit
|
||||
bug,zen,responseAfterCreate
|
||||
bug,zen,responseAfterDelete
|
||||
bug,zen,responseInModal
|
||||
bug,zen,updateBug
|
||||
bug,zen,updateKanbanAfterCreate
|
||||
bug,zen,updateTodoAfterCreate
|
||||
build,zen,assignBugVarsForView
|
||||
build,zen,assignCreateData
|
||||
build,zen,assignEditData
|
||||
build,zen,assignProductVarsForView
|
||||
build,zen,buildBuildForCreate
|
||||
build,zen,buildBuildForEdit
|
||||
build,zen,buildLinkBugSearchForm
|
||||
build,zen,buildLinkStorySearchForm
|
||||
build,zen,getExcludeStoryIdList
|
||||
build,zen,setMenuForView
|
||||
caselib,zen,getRowsForExportTemplate
|
||||
caselib,zen,prepareCasesForBathcCreate
|
||||
caselib,zen,prepareEditExtras
|
||||
caselib,zen,processCasesForExport
|
||||
caselib,zen,responseAfterShowImport
|
||||
chart,zen,getChartsToView
|
||||
chart,zen,getChartToFilter
|
||||
chart,zen,getMenuItems
|
||||
ci,zen,getProductIdAndJobID
|
||||
ci,zen,parseZtfResult
|
||||
company,zen,buildDyanmicSearchForm
|
||||
company,zen,loadAllSearchModule
|
||||
company,zen,loadExecution
|
||||
company,zen,loadProduct
|
||||
company,zen,loadProject
|
||||
company,zen,loadUserModule
|
||||
company,zen,saveUriIntoSession
|
||||
compile,zen,buildSearchForm
|
||||
custom,zen,assignFieldListForSet
|
||||
custom,zen,assignVarsForSet
|
||||
custom,zen,checkDuplicateKeys
|
||||
custom,zen,checkEmptyKeys
|
||||
custom,zen,checkInvalidKeys
|
||||
custom,zen,checkKeysForSet
|
||||
custom,zen,setFieldListForSet
|
||||
custom,zen,setGradeRule
|
||||
custom,zen,setStoryReview
|
||||
custom,zen,setTestcaseReview
|
||||
design,zen,setMenu
|
||||
doc,zen,assignApiVarForSpace
|
||||
doc,zen,assignStoryGradeData
|
||||
doc,zen,assignVarsForCreate
|
||||
doc,zen,assignVarsForMySpace
|
||||
doc,zen,assignVarsForUploadDocs
|
||||
doc,zen,assignVarsForView
|
||||
doc,zen,buildLibForCreateLib
|
||||
doc,zen,buildOutlineList
|
||||
doc,zen,buildOutlineTree
|
||||
doc,zen,buildSearchFormForShowFiles
|
||||
doc,zen,checkPrivForCreate
|
||||
doc,zen,formFromSession
|
||||
doc,zen,getAllSpaces
|
||||
doc,zen,getDocChildrenByRecursion
|
||||
doc,zen,getOutlineParentID
|
||||
doc,zen,initLibForMySpace
|
||||
doc,zen,initLibForTeamSpace
|
||||
doc,zen,prepareCols
|
||||
doc,zen,previewCaselib
|
||||
doc,zen,previeweicket
|
||||
doc,zen,previewER
|
||||
doc,zen,previewExecutionStory
|
||||
doc,zen,previewFeedback
|
||||
doc,zen,previewPlanBug
|
||||
doc,zen,previewPlanStory
|
||||
doc,zen,previewProductBug
|
||||
doc,zen,previewProductCase
|
||||
doc,zen,previewProductplan
|
||||
doc,zen,previewProductStory
|
||||
doc,zen,previewProjectStory
|
||||
doc,zen,previewStory
|
||||
doc,zen,previewTask
|
||||
doc,zen,previewUR
|
||||
doc,zen,processFiles
|
||||
doc,zen,processOutline
|
||||
doc,zen,recordBatchMoveActions
|
||||
doc,zen,responseAfterAddTemplateType
|
||||
doc,zen,responseAfterCreate
|
||||
doc,zen,responseAfterCreateLib
|
||||
doc,zen,responseAfterEdit
|
||||
doc,zen,responseAfterEditTemplate
|
||||
doc,zen,responseAfterMove
|
||||
doc,zen,responseAfterUploadDocs
|
||||
doc,zen,setAclForCreateLib
|
||||
doc,zen,setAclForEditLib
|
||||
doc,zen,setObjectsForCreate
|
||||
doc,zen,setObjectsForEdit
|
||||
doc,zen,setSpacePageStorage
|
||||
editor,zen,buildContentByAction
|
||||
execution,zen,buildExecutionForCreate
|
||||
execution,zen,buildImportBugSearchForm
|
||||
execution,zen,checkCFDDate
|
||||
execution,zen,checkLinkPlan
|
||||
execution,zen,checkPostForCreate
|
||||
execution,zen,filterGroupTasks
|
||||
execution,zen,getAfterCreateLocation
|
||||
execution,zen,buildExecutionKanbanData
|
||||
execution,zen,correctErrorLang
|
||||
execution,zen,getImportBugs
|
||||
execution,zen,getLinkedObjects
|
||||
execution,zen,initFieldsForCreate
|
||||
execution,zen,setRecentExecutions
|
||||
execution,zen,updateLinkedPlans
|
||||
execution,zen,getPrintKanbanData
|
||||
extension,zen,backupDB
|
||||
extension,zen,checkCompatible
|
||||
extension,zen,checkConflicts
|
||||
extension,zen,checkDepends
|
||||
extension,zen,checkExtension
|
||||
extension,zen,checkExtensionPaths
|
||||
extension,zen,checkExtractPath
|
||||
extension,zen,compareForLimit
|
||||
extension,zen,copyPackageFiles
|
||||
extension,zen,extractPackage
|
||||
extension,zen,getHookFile
|
||||
extension,zen,installExtension
|
||||
extension,zen,togglePackageDisable
|
||||
file,zen,updateFileName
|
||||
gitlab,zen,bindUsers
|
||||
gitlab,zen,checkBindedUser
|
||||
gitlab,zen,checkUserRepeat
|
||||
gitlab,zen,getGroupMemberData
|
||||
gitlab,zen,getProjectMemberData
|
||||
gitlab,zen,issueToZentaoObject
|
||||
gitlab,zen,issuetozentoobject
|
||||
gitlab,zen,recordWebhookLogs
|
||||
gitlab,zen,webhookParseBody
|
||||
gitlab,zen,webhookParseIssue
|
||||
gitlab,zen,webhookParseObject
|
||||
group,zen,getNavGroup
|
||||
group,zen,managePrivByModule
|
||||
instance,zen,checkForInstall
|
||||
instance,zen,storeView
|
||||
jenkins,zen,buildTree
|
||||
jenkins,zen,checkTokenAccess
|
||||
job,zen,buildSearchForm
|
||||
job,zen,getCompileData
|
||||
job,zen,getJobList
|
||||
job,zen,getJobSearchQuery
|
||||
job,zen,getSubversionDir
|
||||
job,zen,reponseAfterCreateEdit
|
||||
kanban,zen,assignCreateVars
|
||||
kanban,zen,moveCardByModal
|
||||
kanban,zen,setUserAvatar
|
||||
mail,zen,getHasMailUserPairs
|
||||
metric,zen,formatException
|
||||
metric,zen,getBasicInfo
|
||||
metric,zen,getOldMetricInfo
|
||||
metric,zen,getUniqueKeyByRecord
|
||||
metric,zen,getValidObjects
|
||||
metric,zen,startTime
|
||||
mr,zen,assignEditData
|
||||
mr,zen,buildLinkBugSearchForm
|
||||
mr,zen,buildLinkStorySearchForm
|
||||
mr,zen,buildLinkTaskSearchForm
|
||||
mr,zen,checkNewCommit
|
||||
mr,zen,checkProjectEdit
|
||||
mr,zen,getAllProjects
|
||||
mr,zen,getBranchUrl
|
||||
mr,zen,processLinkTaskPager
|
||||
mr,zen,saveMrData
|
||||
my,zen,assignRelatedData
|
||||
my,zen,buildCaseData
|
||||
my,zen,buildSearchFormForFeedback
|
||||
my,zen,buildTaskData
|
||||
my,zen,showWorkCount
|
||||
my,zen,showWorkCountNotInOpen
|
||||
personnel,zen,setSelectObjectTips
|
||||
pivot,zen,bugAssign
|
||||
pivot,zen,bugCreate
|
||||
pivot,zen,getBuiltinMenus
|
||||
pivot,zen,getDefaultMethodAndParams
|
||||
pivot,zen,getDrill
|
||||
pivot,zen,getfilteroption
|
||||
pivot,zen,getFilterOptionUrl
|
||||
pivot,zen,getMenuItems
|
||||
pivot,zen,getSidebarMenus
|
||||
pivot,zen,productSummary
|
||||
pivot,zen,projectDeviation
|
||||
pivot,zen,setNewMark
|
||||
pivot,zen,show
|
||||
pivot,zen,workload
|
||||
productplan,zen,assignKanbanData
|
||||
productplan,zen,buildActionsList
|
||||
productplan,zen,buildBugSearchForm
|
||||
productplan,zen,buildDataForBrowse
|
||||
productplan,zen,buildLinkStorySearchForm
|
||||
productplan,zen,buildPlansForBatchEdit
|
||||
productplan,zen,buildViewActions
|
||||
productplan,zen,buildViewSummary
|
||||
productplan,zen,getSummary
|
||||
productplan,zen,reorderStories
|
||||
productplan,zen,setSessionForViewPage
|
||||
product,zen,assignBrowseData
|
||||
product,zen,buildBatchEditForm
|
||||
product,zen,buildProductForActivate
|
||||
product,zen,buildProductForClose
|
||||
product,zen,buildProductForCreate
|
||||
product,zen,buildProductForEdit
|
||||
product,zen,buildSearchFormForBrowse
|
||||
product,zen,buildSearchFormForTrack
|
||||
product,zen,getActions4Dashboard
|
||||
product,zen,getActionsForDynamic
|
||||
product,zen,getActiveStoryTypeForTrack
|
||||
product,zen,getBackLink4Create
|
||||
product,zen,getBranchAndTagOption
|
||||
product,zen,getBranchID
|
||||
product,zen,getBranchOptions
|
||||
product,zen,getBrowseProduct
|
||||
product,zen,getCreatedLocate
|
||||
product,zen,getCustomFieldsForTrack
|
||||
product,zen,getEditedLocate
|
||||
product,zen,getEmptyHour
|
||||
product,zen,getExportData
|
||||
product,zen,getExportFields
|
||||
product,zen,getFormFields4Activate
|
||||
product,zen,getFormFields4Close
|
||||
product,zen,getFormFields4Create
|
||||
product,zen,getFormFields4Edit
|
||||
product,zen,getKanbanList
|
||||
product,zen,getModuleId
|
||||
product,zen,getModuleTree
|
||||
product,zen,getProductLines
|
||||
product,zen,getProductList4Kanban
|
||||
product,zen,getProductPlans
|
||||
product,zen,getProducts4DropMenu
|
||||
product,zen,getProjectProductList
|
||||
product,zen,getStories
|
||||
product,zen,getStoriesByStoryType
|
||||
product,zen,getStoryIdList
|
||||
product,zen,getUnauthProgramsOfProducts
|
||||
product,zen,prepareManageLineExtras
|
||||
product,zen,processProjectListData
|
||||
product,zen,responseAfterBatchEdit
|
||||
product,zen,responseAfterCreate
|
||||
product,zen,responseAfterEdit
|
||||
product,zen,responseNotFound4View
|
||||
product,zen,saveAndModifyCookie4Browse
|
||||
product,zen,saveBackUriSession4Dashboard
|
||||
product,zen,saveBackUriSessionForDynamic
|
||||
product,zen,saveSession4Browse
|
||||
product,zen,saveSession4Roadmap
|
||||
product,zen,setCreateMenu
|
||||
product,zen,setEditMenu
|
||||
product,zen,setMenu4All
|
||||
product,zen,setProjectMenu
|
||||
product,zen,setSelectFormOptions
|
||||
product,zen,setShowErrorNoneMenu
|
||||
product,zen,setShowErrorNoneMenu4Execution
|
||||
product,zen,setShowErrorNoneMenu4Project
|
||||
product,zen,setShowErrorNoneMenu4QA
|
||||
product,zen,setTrackMenu
|
||||
programplan,zen,buildStages
|
||||
programplan,zen,computeFieldsCreateView
|
||||
programplan,zen,prepareEditPlan
|
||||
program,zen,buildProgramForCreate
|
||||
program,zen,buildProgramForEdit
|
||||
program,zen,buildTree
|
||||
program,zen,getKanbanList
|
||||
program,zen,getLink
|
||||
program,zen,getProductsByBrowseType
|
||||
program,zen,getProgramList4Kanban
|
||||
program,zen,getProgramsByType
|
||||
program,zen,prepareStartExtras
|
||||
program,zen,removeSubjectToCurrent
|
||||
projectrelease,zen,buildReleaseForCreate
|
||||
projectrelease,zen,commonAction
|
||||
project,zen,assignTesttaskVars
|
||||
project,zen,buildActivateForm
|
||||
project,zen,buildBugView
|
||||
project,zen,buildCreateForm
|
||||
project,zen,buildMembers
|
||||
project,zen,buildStartForm
|
||||
project,zen,buildSuspendForm
|
||||
project,zen,buildUsers
|
||||
project,zen,checkDaysAndBudget
|
||||
project,zen,checkProductAndBranch
|
||||
project,zen,checkWorkdaysLegtimate
|
||||
project,zen,displayAfterCreated
|
||||
project,zen,expandExecutionIdList
|
||||
project,zen,extractUnModifyForm
|
||||
project,zen,getKanbanData
|
||||
project,zen,getOtherProducts
|
||||
project,zen,prepareBranchForBug
|
||||
project,zen,prepareClosedExtras
|
||||
project,zen,prepareModuleForBug
|
||||
project,zen,prepareProject
|
||||
project,zen,prepareStartExtras
|
||||
project,zen,prepareSuspendExtras
|
||||
project,zen,processBugSearchParams
|
||||
project,zen,processbuildserachparams
|
||||
project,zen,processGroupPrivs
|
||||
project,zen,recordExecutionsOfUnlinkedProducts
|
||||
project,zen,removeAssociatedProducts
|
||||
project,zen,responseAfterClose
|
||||
project,zen,updateLinkedProducts
|
||||
release,zen,buildBugDataForExport
|
||||
release,zen,buildLinkBugSearchForm
|
||||
release,zen,buildSearchForm
|
||||
release,zen,getExcludeStoryIdList
|
||||
release,zen,getSearchQuery
|
||||
report,zen,assignAnnualBaseData
|
||||
report,zen,assignAnnualData
|
||||
report,zen,assignAnnualReport
|
||||
report,zen,getReminder
|
||||
repo,zen,buildCreateRepoForm
|
||||
repo,zen,buildEditForm
|
||||
repo,zen,buildRepoTree
|
||||
repo,zen,checkACL
|
||||
repo,zen,checkClient
|
||||
repo,zen,checkSyncResult
|
||||
repo,zen,encodingDiff
|
||||
repo,zen,getBranchAndTagItems
|
||||
repo,zen,getCommits
|
||||
repo,zen,getFilesInfo
|
||||
repo,zen,getLinkBranches
|
||||
repo,zen,getLinkExecutions
|
||||
repo,zen,getLinkModules
|
||||
repo,zen,getSearchFormQuery
|
||||
repo,zen,getSyncBranches
|
||||
repo,zen,getViewTree
|
||||
repo,zen,prepareCreate
|
||||
repo,zen,prepareCreateRepo
|
||||
repo,zen,prepareEdit
|
||||
repo,zen,setBrowseSession
|
||||
repo,zen,syncLocalCommit
|
||||
screen,zen,commonAction
|
||||
screen,zen,prepareCardList
|
||||
screen,zen,setSelectFilter
|
||||
search,zen,getTypeList
|
||||
search,zen,setOptionAndOr
|
||||
search,zen,setOptionFields
|
||||
search,zen,setOptionOperators
|
||||
search,zen,setOptions
|
||||
search,zen,setSessionForIndex
|
||||
sonarqube,zen,checkTokenRequire
|
||||
sonarqube,zen,sortAndPage
|
||||
sso,zen,buildLocationByGET
|
||||
sso,zen,buildLocationByPATHINFO
|
||||
sso,zen,buildSSOParams
|
||||
sso,zen,buildUserForCreate
|
||||
sso,zen,computeAuth
|
||||
sso,zen,getBindFeishuUser
|
||||
sso,zen,getFeishuAccessToken
|
||||
sso,zen,getFeishuUserToken
|
||||
sso,zen,idenfyFromSSO
|
||||
sso,zen,locateNotifyLink
|
||||
store,zen,getInstalledApps
|
||||
story,zen,buildDataForBatchToTask
|
||||
story,zen,buildStoryForChange
|
||||
story,zen,convertChildID
|
||||
story,zen,getAfterBatchCreateLocation
|
||||
story,zen,getAfterCreateLocation
|
||||
story,zen,getAfterEditLocation
|
||||
story,zen,getAfterReviewLocation
|
||||
story,zen,getAssignMeBlockID
|
||||
story,zen,getCustomFields
|
||||
story,zen,getDataFromUploadImages
|
||||
story,zen,getFormFieldsForChange
|
||||
sonarqube,zen,getIssueList
|
||||
story,zen,getFormFieldsForCreate
|
||||
story,zen,getFormFieldsForEdit
|
||||
story,zen,getFormFieldsForReview
|
||||
story,zen,getFormOptionsForSingleProduct
|
||||
story,zen,getInitStoryByBug
|
||||
story,zen,getLinkedObjects
|
||||
story,zen,getProductsForEdit
|
||||
story,zen,getResponseInModal
|
||||
story,zen,getStoriesByChecked
|
||||
story,zen,hiddenFormFieldsForEdit
|
||||
story,zen,processDataForEdit
|
||||
story,zen,processFilterTitle
|
||||
story,zen,removeFormFieldsForBatchCreate
|
||||
story,zen,setFormOptionsForBatchEdit
|
||||
story,zen,setHiddenFieldsForView
|
||||
story,zen,setViewVarsForKanban
|
||||
system,zen,getCpuUsage
|
||||
system,zen,getMemUsage
|
||||
task,zen,assignBatchEditVars
|
||||
task,zen,assignCreateVars
|
||||
task,zen,buildBatchCreateForm
|
||||
task,zen,buildEffortForFinish
|
||||
task,zen,buildRecordForm
|
||||
task,zen,buildTaskForClose
|
||||
task,zen,buildTaskForEdit
|
||||
task,zen,buildTasksForBatchCreate
|
||||
task,zen,checkCreateTestTasks
|
||||
task,zen,formatExportTask
|
||||
task,zen,generalCreateResponse
|
||||
task,zen,getAssignedToOptions
|
||||
task,zen,getCustomFields
|
||||
task,zen,getExportFields
|
||||
task,zen,processExportData
|
||||
task,zen,responseAfterRecord
|
||||
task,zen,responseModal
|
||||
testcase,zen,addEditAction
|
||||
testcase,zen,assignBranchForEdit
|
||||
testcase,zen,assignCasesForBrowse
|
||||
testcase,zen,assigncreatesceneVars
|
||||
testcase,zen,assignCreateVars
|
||||
testcase,zen,assignForBatchCreate
|
||||
testcase,zen,assignForBatchEdit
|
||||
testcase,zen,assignForBrowse
|
||||
testcase,zen,assignModuleOptionMenuForEdit
|
||||
testcase,zen,assignProductAndBranchForBrowse
|
||||
testcase,zen,assignShowImportVars
|
||||
testcase,zen,assignTitleForBatchEdit
|
||||
testcase,zen,buildBrowseSearchForm
|
||||
testcase,zen,buildCasesForBathcCreate
|
||||
testcase,zen,buildLinkCasesSearchForm
|
||||
testcase,zen,buildUpdateCaseForShowImport
|
||||
testcase,zen,checkCasesForShowImport
|
||||
testcase,zen,checkProducts
|
||||
testcase,zen,getBrowseBranch
|
||||
testcase,zen,getGroupCases
|
||||
testcase,zen,getImportedData
|
||||
testcase,zen,getImportField
|
||||
testcase,zen,importCases
|
||||
testcase,zen,initLibCase
|
||||
testcase,zen,parseUploadFile
|
||||
testcase,zen,prepareEditExtras
|
||||
testcase,zen,getStatusForUpdate
|
||||
testcase,zen,prepareReviewData
|
||||
testcase,zen,preProcessForEdit
|
||||
testcase,zen,processCaseForExport
|
||||
testcase,zen,processCasesForBrowse
|
||||
testcase,zen,processCasesForExport
|
||||
testcase,zen,processFileForExport
|
||||
testcase,zen,processLinkCaseForExport
|
||||
testcase,zen,responseAfterBatchCreate
|
||||
testcase,zen,responseAfterShowImport
|
||||
testcase,zen,setBrowseCookie
|
||||
testcase,zen,setBrowseMenu
|
||||
testcase,zen,setMenuForCaseEdit
|
||||
testreport,zen,assignReportData
|
||||
testreport,zen,buildReportDataForView
|
||||
testreport,zen,commonAction
|
||||
testreport,zen,getGeneratedAndLegacyBugData
|
||||
testreport,zen,getReportsForBrowse
|
||||
testreport,zen,getStageAndHandleGroups
|
||||
testtask,zen,assignForCases
|
||||
testtask,zen,responseAfterRunCase
|
||||
todo,zen,assembleExportData
|
||||
todo,zen,beforeBatchEdit
|
||||
todo,zen,beforeEdit
|
||||
todo,zen,buildCreateView
|
||||
transfer,zen,buildNextList
|
||||
transfer,zen,printCell
|
||||
transfer,zen,printRow
|
||||
tree,zen,setRoot
|
||||
webhook,zen,getResponse
|
||||
zanode,zen,getServiceStatus
|
||||
zanode,zen,getTaskStatus
|
||||
user,zen,checkDirPermission
|
||||
user,zen,getUserForJSON
|
||||
user,zen,parseLoginModuleAndMethod
|
||||
user,zen,prepareCustomFields
|
||||
zanode,zen,handleNode
|
||||
zanode,zen,installService
|
||||
zanode,zen,prepareCreateExtras
|
||||
zanode,zen,prepareCreateSnapshotExtras
|
||||
|
||||
|
@@ -74,10 +74,10 @@ process_method() {
|
||||
local commits=$(git log --oneline --follow -- "$test_file" | awk '{print $1}')
|
||||
local all_generated=true
|
||||
|
||||
# 如果每一个提交信息都包含Claude Code则该文件是自动生成的。
|
||||
# 如果提交信息内容为" + [unittest] add cid."或者"* [refac] Refactor the test class of user zen"或者包含Claude Code则认为该文件是自动生成的。
|
||||
for commit in $commits; do
|
||||
local commit_msg=$(git log -1 --format=%B "$commit")
|
||||
if [[ "$commit_msg" != *"Claude Code"* ]]; then
|
||||
if [[ "$commit_msg" != " + [unittest] add cid." && "$commit_msg" != "* [refac] Refactor the test class of user zen." && "$commit_msg" != *"Claude Code"* ]]; then
|
||||
all_generated=false
|
||||
break
|
||||
fi
|
||||
|
||||
@@ -3694,7 +3694,7 @@ CREATE TABLE `zt_testtask` (
|
||||
`product` mediumint unsigned NOT NULL DEFAULT '0',
|
||||
`name` char(90) NOT NULL DEFAULT '',
|
||||
`execution` mediumint unsigned NOT NULL DEFAULT '0',
|
||||
`build` char(30) NOT NULL DEFAULT '',
|
||||
`build` int unsigned NOT NULL DEFAULT 0,
|
||||
`type` varchar(255) NOT NULL DEFAULT '',
|
||||
`owner` varchar(30) NOT NULL DEFAULT '',
|
||||
`pri` tinyint unsigned NOT NULL DEFAULT '0',
|
||||
|
||||
@@ -25,3 +25,7 @@ CREATE TABLE `zt_testtaskproduct` (
|
||||
CREATE UNIQUE INDEX `uk_productbuild` ON `zt_testtaskproduct` (`product`,`build`,`task`);
|
||||
|
||||
ALTER TABLE `zt_testtask` ADD `joint` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否为联调测试单' AFTER `build`;
|
||||
|
||||
UPDATE `zt_testtask` SET `build` = 0 WHERE `build` = 'trunk' OR `build` = '' OR `build` IS NULL;
|
||||
|
||||
ALTER TABLE `zt_testtask` MODIFY `build` int unsigned NOT NULL DEFAULT 0;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
USE `__TABLE__`;
|
||||
USE `__DATABASE__`;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_acl`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_acl` (
|
||||
@@ -2388,7 +2388,7 @@ CREATE TABLE IF NOT EXISTS `zt_testtask` (
|
||||
`product` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '所属产品',
|
||||
`name` char(90) NOT NULL DEFAULT '' COMMENT '测试单名称',
|
||||
`execution` mediumint(8) unsigned NOT NULL default '0' COMMENT '所属执行',
|
||||
`build` char(30) NOT NULL DEFAULT '' COMMENT '所属构建',
|
||||
`build` int unsigned NOT NULL DEFAULT 0 COMMENT '所属构建',
|
||||
`joint` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否为联调测试单',
|
||||
`type` varchar(255) NOT NULL DEFAULT '' COMMENT '类型',
|
||||
`owner` varchar(30) NOT NULL DEFAULT '' COMMENT '负责人',
|
||||
|
||||
@@ -57,13 +57,13 @@ formPanel
|
||||
set::label($lang->execution->name),
|
||||
set::value($execution->name)
|
||||
),
|
||||
formGroup
|
||||
!empty($config->setCode) ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::name('code'),
|
||||
set::label($lang->execution->code),
|
||||
set::value($execution->code)
|
||||
),
|
||||
) : null,
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
|
||||
@@ -1055,9 +1055,6 @@ class baseControl
|
||||
$content = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
$find = array('<', '>', '&', ''', '"');
|
||||
$replace = array('<', '>', '&', "'", '\\\\"');
|
||||
$content = str_replace($find, $replace, $content);
|
||||
echo $content;
|
||||
|
||||
/**
|
||||
|
||||
@@ -478,7 +478,7 @@ class dbh
|
||||
{
|
||||
case 'mysql':
|
||||
$result = $this->getServerCharsetAndCollation();
|
||||
$sql = "CREATE DATABASE `{$this->dbConfig->name}` CHARACTER SET {$result['charset']} COLLATE {$result['collation']}";
|
||||
$sql = "CREATE DATABASE `{$this->dbConfig->name}` DEFAULT CHARACTER SET {$result['charset']} COLLATE {$result['collation']}";
|
||||
return $this->rawQuery($sql);
|
||||
case 'dm':
|
||||
$createSchema = "CREATE SCHEMA {$this->dbConfig->name} AUTHORIZATION {$this->dbConfig->user}";
|
||||
|
||||
@@ -1593,8 +1593,8 @@ class actionModel extends model
|
||||
|
||||
if(empty($action->hasLink) && $this->actionTao->checkActionClickable($action, $deptUsers, $moduleName, $methodName)) $action->objectLink = helper::createLink($moduleName, $methodName, $params);
|
||||
|
||||
/* Set app for no multiple project. */
|
||||
if(!empty($action->objectLink) && !empty($project) && empty($project->multiple)) $action->objectLink .= '#app=project';
|
||||
if(!empty($action->objectLink) && !empty($project) && empty($project->multiple)) $action->objectLink .= '#app=project'; // Set app for no multiple project.
|
||||
if(!empty($action->objectLink) && $action->objectType == 'meeting') $action->objectLink .= '#app=' . $this->app->tab; // Set app for meeting by open tab.
|
||||
if($this->config->vision == 'lite' && $action->objectType == 'module') $action->objectLink .= '#app=project';
|
||||
|
||||
return $action;
|
||||
|
||||
@@ -1132,13 +1132,18 @@ class actionTest
|
||||
/**
|
||||
* Test processCreateRequirementsActionExtra method.
|
||||
*
|
||||
* @param object $action
|
||||
* @param string $storyIds
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processCreateRequirementsActionExtraTest(object $action): object
|
||||
public function processCreateRequirementsActionExtraTest(string $storyIds): object
|
||||
{
|
||||
// 创建模拟的action对象
|
||||
$action = new stdClass();
|
||||
$action->extra = $storyIds;
|
||||
|
||||
$this->objectTao->processCreateRequirementsActionExtra($action);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $action;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
|
||||
class actionTaoTest
|
||||
{
|
||||
public $objectModel;
|
||||
public $objectTao;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('action');
|
||||
$this->objectTao = $tester->loadTao('action');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test processLinkStoryAndBugActionExtra method.
|
||||
*
|
||||
* @param string $ids
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processLinkStoryAndBugActionExtraTest(string $ids, string $module = 'story', string $method = 'view'): object
|
||||
{
|
||||
$action = new stdClass();
|
||||
$action->extra = $ids;
|
||||
|
||||
$this->objectTao->processLinkStoryAndBugActionExtra($action, $module, $method);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test processToStoryActionExtra method.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @param string $product
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processToStoryActionExtraTest(int $storyID, string $product = '1'): object
|
||||
{
|
||||
$action = new stdClass();
|
||||
$action->extra = (string)$storyID;
|
||||
$action->product = $product;
|
||||
|
||||
$this->objectTao->processToStoryActionExtra($action);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $action;
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
title=测试 actionTao::processCreateChildrenActionExtra();
|
||||
timeout=0
|
||||
cid=14961
|
||||
cid=0
|
||||
|
||||
- 步骤1:单个任务ID属性extra @#1 实现用户登录功能
|
||||
- 步骤2:多个任务ID属性extra @#1 实现用户登录功能, #2 开发API接口, #3 编写单元测试
|
||||
- 步骤3:不存在的任务ID属性extra @~~
|
||||
- 步骤4:空字符串属性extra @~~
|
||||
- 步骤5:混合存在和不存在的任务ID属性extra @#1 实现用户登录功能, #2 开发API接口
|
||||
- 步骤1:单个任务ID属性extra @#1 A
|
||||
- 步骤2:多个任务ID属性extra @#1 A, #2 B, #3 C
|
||||
- 步骤3:不存在的任务ID属性extra @~~
|
||||
- 步骤4:空字符串属性extra @~~
|
||||
- 步骤5:混合存在和不存在的任务ID属性extra @#1 A, #2 B
|
||||
|
||||
*/
|
||||
|
||||
@@ -20,9 +20,9 @@ include dirname(__FILE__, 2) . '/lib/action.unittest.class.php';
|
||||
|
||||
$taskTable = zenData('task');
|
||||
$taskTable->id->range('1-10');
|
||||
$taskTable->name->range('实现用户登录功能,开发API接口,编写单元测试,修复Bug问题,数据库设计,前端页面开发,系统集成测试,性能优化,代码审查,文档编写');
|
||||
$taskTable->type->range('devel{5},test{3},design{2}');
|
||||
$taskTable->status->range('wait{3},doing{4},done{2},cancel{1}');
|
||||
$taskTable->name->range('A,B,C,D,E,F,G,H,I,J');
|
||||
$taskTable->type->range('devel{3},test{3},design{2},study,misc');
|
||||
$taskTable->status->range('wait{2},doing{3},done{3},pause,cancel');
|
||||
$taskTable->project->range('1-3');
|
||||
$taskTable->execution->range('1-3');
|
||||
$taskTable->gen(10);
|
||||
@@ -31,8 +31,8 @@ su('admin');
|
||||
|
||||
$actionTest = new actionTest();
|
||||
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1')) && p('extra') && e('#1 实现用户登录功能');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1,2,3')) && p('extra') && e('#1 实现用户登录功能, #2 开发API接口, #3 编写单元测试');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('999')) && p('extra') && e('');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('')) && p('extra') && e('');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1,999,2')) && p('extra') && e('#1 实现用户登录功能, #2 开发API接口');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1')) && p('extra') && e('#1 A');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1,2,3')) && p('extra') && e('#1 A, #2 B, #3 C');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('999')) && p('extra') && e('~~');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('')) && p('extra') && e('~~');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1,999,2')) && p('extra') && e('#1 A, #2 B');
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
|
||||
title=测试 actionTao::processCreateChildrenActionExtra();
|
||||
timeout=0
|
||||
cid=14962
|
||||
|
||||
- 测试单个有效任务ID >> 返回格式化的任务信息
|
||||
- 测试多个有效任务ID >> 返回多个任务信息
|
||||
- 测试不存在的任务ID >> 返回空字符串
|
||||
- 测试空字符串输入 >> 返回空字符串
|
||||
- 测试混合有效和无效ID >> 只返回有效任务信息
|
||||
- 测试大量任务ID >> 正确处理所有有效任务
|
||||
- 测试包含空格的ID字符串 >> 正确处理并过滤空格
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/action.unittest.class.php';
|
||||
|
||||
zenData('task')->loadYaml('task_processcreatechilredactionextra', false, 2)->gen(10);
|
||||
zenData('user')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$actionTest = new actionTest();
|
||||
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1')) && p('extra') && e('#1 开发任务11');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1,2,3')) && p('extra') && e('#1 开发任务11, #2 开发任务12, #3 开发任务13');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('999')) && p('extra') && e('~~');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('')) && p('extra') && e('~~');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1,999,2')) && p('extra') && e('#1 开发任务11, #2 开发任务12');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1,2,3,4,5')) && p('extra') && e('#1 开发任务11, #2 开发任务12, #3 开发任务13, #4 开发任务14, #5 开发任务15');
|
||||
r($actionTest->processCreateChildrenActionExtraTest('1, 2, 3')) && p('extra') && e('#1 开发任务11, #2 开发任务12, #3 开发任务13');
|
||||
@@ -3,32 +3,38 @@
|
||||
|
||||
/**
|
||||
|
||||
title=- 单个ID @
|
||||
title=- 步骤1:单个需求ID属性extra @
|
||||
timeout=0
|
||||
cid=14963
|
||||
cid=1
|
||||
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法 属性extra @#1 用户需求1
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法
|
||||
- 属性extra @#1 用户需求1
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法 属性extra @0
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法 属性extra @0
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法
|
||||
- 属性extra @#1 用户需求1
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法,参数是'1' 属性extra @#1 需求A
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法,参数是'1, 2, 3'
|
||||
- 属性extra @#1 需求A
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法,参数是'999' 属性extra @~~
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法,参数是'' 属性extra @~~
|
||||
- 执行actionTest模块的processCreateRequirementsActionExtraTest方法,参数是'1, 999, 2'
|
||||
- 属性extra @#1 需求A
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/action.unittest.class.php';
|
||||
|
||||
zenData('story')->loadYaml('story_processcreaterequirementsactionextra', false, 2)->gen(10);
|
||||
zenData('user')->gen(5);
|
||||
$storyTable = zenData('story');
|
||||
$storyTable->id->range('1-10');
|
||||
$storyTable->title->range('需求A,需求B,需求C,需求D,需求E,需求F,需求G,需求H,需求I,需求J');
|
||||
$storyTable->type->range('requirement');
|
||||
$storyTable->product->range('1-3');
|
||||
$storyTable->status->range('active{5},closed{3},draft{2}');
|
||||
$storyTable->openedBy->range('admin,user1,user2,admin,user1,user2,admin,user1,user2,admin');
|
||||
$storyTable->gen(10);
|
||||
|
||||
su('admin');
|
||||
|
||||
$actionTest = new actionTest();
|
||||
|
||||
r($actionTest->processCreateRequirementsActionExtraTest((object)array('extra' => '1'))) && p('extra') && e('#1 用户需求1');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest((object)array('extra' => '1,2,3'))) && p('extra') && e('#1 用户需求1, #2 软件需求2, #3 用户需求3');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest((object)array('extra' => '999'))) && p('extra') && e('0');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest((object)array('extra' => ''))) && p('extra') && e('0');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest((object)array('extra' => '1,999,2'))) && p('extra') && e('#1 用户需求1, #2 软件需求2');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest('1')) && p('extra') && e('#1 需求A');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest('1,2,3')) && p('extra') && e('#1 需求A, #2 需求B, #3 需求C');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest('999')) && p('extra') && e('~~');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest('')) && p('extra') && e('~~');
|
||||
r($actionTest->processCreateRequirementsActionExtraTest('1,999,2')) && p('extra') && e('#1 需求A, #2 需求B');
|
||||
@@ -1,32 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
|
||||
title=- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'1', 'story', 'view' 属性extra @
|
||||
title=- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'1'属性extra @
|
||||
timeout=0
|
||||
cid=14964
|
||||
cid=1
|
||||
|
||||
- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'1', 'story', 'view' 属性extra @#1
|
||||
- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'1, 2, 3', 'story', 'view'
|
||||
- 属性extra @#1
|
||||
- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'1', 'bug', 'view' 属性extra @#1
|
||||
- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'5, 10', 'bug', 'view'
|
||||
- 属性extra @#5
|
||||
- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'100', 'bug', 'view' 属性extra @#100
|
||||
- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'100, 101, 102, 103', 'bug', 'view'
|
||||
- 属性extra @#100
|
||||
- 执行actionTest模块的processLinkStoryAndBugActionExtraTest方法,参数是'', 'story', 'view' 属性extra @#
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/action.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/tao.class.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
$actionTest = new actionTest();
|
||||
$actionTest = new actionTaoTest();
|
||||
|
||||
r($actionTest->processLinkStoryAndBugActionExtraTest('1', 'story', 'view')) && p('extra') && e('#1');
|
||||
r($actionTest->processLinkStoryAndBugActionExtraTest('1,2,3', 'story', 'view')) && p('extra') && e('#1, #2, #3');
|
||||
r($actionTest->processLinkStoryAndBugActionExtraTest('1', 'bug', 'view')) && p('extra') && e('#1');
|
||||
r($actionTest->processLinkStoryAndBugActionExtraTest('5,10', 'bug', 'view')) && p('extra') && e('#5, #10');
|
||||
r($actionTest->processLinkStoryAndBugActionExtraTest('100', 'bug', 'view')) && p('extra') && e('#100');
|
||||
r($actionTest->processLinkStoryAndBugActionExtraTest('100,101,102,103', 'bug', 'view')) && p('extra') && e('#100, #101, #102, #103');
|
||||
r($actionTest->processLinkStoryAndBugActionExtraTest('', 'story', 'view')) && p('extra') && e('#');
|
||||
@@ -1,72 +1,53 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
|
||||
title=- 测试非影子产品的故事action extra处理属性extra @*
|
||||
title=- 执行actionTest模块的processToStoryActionExtraTest方法,参数是1, '1' 属性extra @
|
||||
timeout=0
|
||||
cid=14968
|
||||
cid=1
|
||||
|
||||
- 测试非影子产品的故事action extra处理属性extra @*#1 用户故事1*
|
||||
- 测试影子产品的故事action extra处理(有项目关联)属性extra @*#4 需求1*
|
||||
- 测试影子产品的故事action extra处理(无项目关联)属性extra @*#8 Feature1*
|
||||
- 测试不存在的故事ID属性extra @999
|
||||
- 测试产品字段为空的情况属性extra @*#2 用户故事2*
|
||||
- 执行actionTest模块的processToStoryActionExtraTest方法,参数是1, '1' 属性extra @#1 用户需求1
|
||||
- 执行actionTest模块的processToStoryActionExtraTest方法,参数是2, '2' 属性extra @#2 软件需求2
|
||||
- 执行actionTest模块的processToStoryActionExtraTest方法,参数是3, '2' 属性extra @#3 用户需求3
|
||||
- 执行actionTest模块的processToStoryActionExtraTest方法,参数是4, '2' 属性extra @#4 软件需求4
|
||||
- 执行actionTest模块的processToStoryActionExtraTest方法,参数是999, '2' 属性extra @#999
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/action.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/tao.class.php';
|
||||
|
||||
$productTable = zenData('product');
|
||||
$productTable->id->range('1-10');
|
||||
$productTable->name->range('正常产品,影子产品{5},测试产品{4}');
|
||||
$productTable->shadow->range('0,1,1,1,1,1,0,0,0,0');
|
||||
$productTable->status->range('normal{10}');
|
||||
$productTable->type->range('normal{10}');
|
||||
$productTable->gen(10);
|
||||
|
||||
$storyTable = zenData('story');
|
||||
$storyTable->id->range('1-10');
|
||||
$storyTable->product->range('1,2,2,2,6,6,1,8,9,10');
|
||||
$storyTable->type->range('story{10}');
|
||||
$storyTable->status->range('active{10}');
|
||||
$storyTable->stage->range('wait{5},planned{5}');
|
||||
$storyTable->version->range('1{10}');
|
||||
$storyTable->gen(10);
|
||||
|
||||
$projectStoryTable = zenData('projectstory');
|
||||
$projectStoryTable->project->range('10,20,30,40,50');
|
||||
$projectStoryTable->product->range('2,2,2,6,6');
|
||||
$projectStoryTable->story->range('2,3,4,5,6');
|
||||
$projectStoryTable->version->range('1{5}');
|
||||
$projectStoryTable->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$product = zenData('product');
|
||||
$product->id->range('1-5');
|
||||
$product->name->range('产品1,产品2,产品3,影子产品1,影子产品2');
|
||||
$product->shadow->range('0{3},1{2}');
|
||||
$product->gen(5);
|
||||
$actionTest = new actionTaoTest();
|
||||
|
||||
$story = zenData('story');
|
||||
$story->id->range('1-10');
|
||||
$story->product->range('1-5');
|
||||
$story->title->range('用户故事1,用户故事2,用户故事3,需求1,需求2,Epic1,Epic2,Feature1,Feature2,Story10');
|
||||
$story->type->range('story{7},requirement{2},epic');
|
||||
$story->gen(10);
|
||||
|
||||
$projectstory = zenData('projectstory');
|
||||
$projectstory->project->range('101-105');
|
||||
$projectstory->story->range('4,5,4,6,7');
|
||||
$projectstory->gen(5);
|
||||
|
||||
$actionTest = new actionTest();
|
||||
|
||||
$action1 = new stdClass();
|
||||
$action1->objectID = 1;
|
||||
$action1->product = '1';
|
||||
$action1->extra = '1';
|
||||
r($actionTest->processToStoryActionExtraTest($action1)) && p('extra') && e('*#1 用户故事1*'); // 测试非影子产品的故事action extra处理
|
||||
|
||||
$action2 = new stdClass();
|
||||
$action2->objectID = 2;
|
||||
$action2->product = '4';
|
||||
$action2->extra = '4';
|
||||
r($actionTest->processToStoryActionExtraTest($action2)) && p('extra') && e('*#4 需求1*'); // 测试影子产品的故事action extra处理(有项目关联)
|
||||
|
||||
$action3 = new stdClass();
|
||||
$action3->objectID = 3;
|
||||
$action3->product = '5';
|
||||
$action3->extra = '8';
|
||||
r($actionTest->processToStoryActionExtraTest($action3)) && p('extra') && e('*#8 Feature1*'); // 测试影子产品的故事action extra处理(无项目关联)
|
||||
|
||||
$action4 = new stdClass();
|
||||
$action4->objectID = 4;
|
||||
$action4->product = '1';
|
||||
$action4->extra = '999';
|
||||
r($actionTest->processToStoryActionExtraTest($action4)) && p('extra') && e('999'); // 测试不存在的故事ID
|
||||
|
||||
$action5 = new stdClass();
|
||||
$action5->objectID = 5;
|
||||
$action5->product = '';
|
||||
$action5->extra = '2';
|
||||
r($actionTest->processToStoryActionExtraTest($action5)) && p('extra') && e('*#2 用户故事2*'); // 测试产品字段为空的情况
|
||||
r($actionTest->processToStoryActionExtraTest(1, '1')) && p('extra') && e('#1 用户需求1');
|
||||
r($actionTest->processToStoryActionExtraTest(2, '2')) && p('extra') && e('#2 软件需求2');
|
||||
r($actionTest->processToStoryActionExtraTest(3, '2')) && p('extra') && e('#3 用户需求3');
|
||||
r($actionTest->processToStoryActionExtraTest(4, '2')) && p('extra') && e('#4 软件需求4');
|
||||
r($actionTest->processToStoryActionExtraTest(999, '2')) && p('extra') && e('#999');
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
title: 产品测试数据
|
||||
desc: processToStoryActionExtra方法的产品测试数据
|
||||
author: Claude
|
||||
version: 1.0
|
||||
|
||||
fields:
|
||||
- field: id
|
||||
note: 产品ID
|
||||
range: 1-10
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: name
|
||||
note: 产品名称
|
||||
range: '正常产品,影子产品{5},测试产品{4}'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: shadow
|
||||
note: 是否为影子产品(0=正常,1=影子)
|
||||
range: '0,1,1,1,1,1,0,0,0,0'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: code
|
||||
note: 产品代码
|
||||
range: 'product1,product2,product3,product4,product5,product6,product7,product8,product9,product10'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: status
|
||||
note: 产品状态
|
||||
range: 'normal{10}'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: type
|
||||
note: 产品类型
|
||||
range: 'normal{10}'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: deleted
|
||||
note: 是否删除
|
||||
range: '0{10}'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: 项目需求关联测试数据
|
||||
desc: processToStoryActionExtra方法的项目需求关联测试数据
|
||||
author: Claude
|
||||
version: 1.0
|
||||
|
||||
fields:
|
||||
- field: project
|
||||
note: 项目ID
|
||||
range: '10,20,30,40,50'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: product
|
||||
note: 产品ID
|
||||
range: '2,2,2,6,6'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: story
|
||||
note: 需求ID
|
||||
range: '2,3,4,5,6'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: version
|
||||
note: 版本
|
||||
range: '1{5}'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: order
|
||||
note: 排序
|
||||
range: '1-5'
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: 需求测试数据
|
||||
desc: processToStoryActionExtra方法的需求测试数据
|
||||
author: Claude
|
||||
version: 1.0
|
||||
|
||||
fields:
|
||||
- field: id
|
||||
note: 需求ID
|
||||
range: 1-10
|
||||
- field: product
|
||||
note: 所属产品
|
||||
range: '1,2,2,2,6,6,1,8,9,10'
|
||||
- field: title
|
||||
note: 需求标题
|
||||
range: 1-10
|
||||
format: "需求标题%d"
|
||||
- field: type
|
||||
note: 需求类型
|
||||
range: 'story{10}'
|
||||
- field: status
|
||||
note: 需求状态
|
||||
range: 'active{10}'
|
||||
- field: stage
|
||||
note: 需求阶段
|
||||
range: 'wait{5},planned{5}'
|
||||
- field: openedBy
|
||||
note: 创建人
|
||||
range: 'admin{10}'
|
||||
- field: version
|
||||
note: 版本号
|
||||
range: '1{10}'
|
||||
- field: deleted
|
||||
note: 是否删除
|
||||
range: '0{10}'
|
||||
@@ -139,7 +139,7 @@ class backupModel extends model
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->dbh->query("DROP $tableType IF EXISTS `$tableName`");
|
||||
$this->dbh->exec("DROP $tableType IF EXISTS `$tableName`");
|
||||
}
|
||||
catch(PDOException $e){}
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::createMoreLink();
|
||||
timeout=0
|
||||
cid=15238
|
||||
|
||||
- 步骤1:测试recentproject类型block的moreLink生成属性moreLink @project-browse
|
||||
- 步骤2:测试带type参数的bug类型block的moreLink生成属性moreLink @my-bug-type=assignedTo
|
||||
- 步骤3:测试dynamic类型block的moreLink生成属性moreLink @my-dynamic
|
||||
- 步骤4:测试未配置的block返回空moreLink属性moreLink @~~
|
||||
- 步骤5:测试testtask类型block的moreLink生成属性moreLink @testtask-browse-type=
|
||||
- 步骤6:测试带空type的case类型block的moreLink生成属性moreLink @my-testcase-type=
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 准备测试数据
|
||||
$block1 = new stdclass();
|
||||
$block1->id = 1;
|
||||
$block1->module = 'project';
|
||||
$block1->code = 'recentproject';
|
||||
$block1->params = new stdclass();
|
||||
|
||||
$block2 = new stdclass();
|
||||
$block2->id = 2;
|
||||
$block2->module = 'qa';
|
||||
$block2->code = 'bug';
|
||||
$block2->params = new stdclass();
|
||||
$block2->params->type = 'assignedTo';
|
||||
|
||||
$block3 = new stdclass();
|
||||
$block3->id = 3;
|
||||
$block3->module = 'common';
|
||||
$block3->code = 'dynamic';
|
||||
$block3->params = new stdclass();
|
||||
|
||||
$block4 = new stdclass();
|
||||
$block4->id = 4;
|
||||
$block4->module = 'project';
|
||||
$block4->code = 'execution';
|
||||
$block4->params = new stdclass();
|
||||
|
||||
$block5 = new stdclass();
|
||||
$block5->id = 5;
|
||||
$block5->module = 'qa';
|
||||
$block5->code = 'testtask';
|
||||
$block5->params = new stdclass();
|
||||
|
||||
$block6 = new stdclass();
|
||||
$block6->id = 6;
|
||||
$block6->module = 'qa';
|
||||
$block6->code = 'case';
|
||||
$block6->params = new stdclass();
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->createMoreLinkTest($block1, 100)) && p('moreLink') && e('project-browse'); // 步骤1:测试recentproject类型block的moreLink生成
|
||||
r($blockTest->createMoreLinkTest($block2, 100)) && p('moreLink') && e('my-bug-type=assignedTo'); // 步骤2:测试带type参数的bug类型block的moreLink生成
|
||||
r($blockTest->createMoreLinkTest($block3, 100)) && p('moreLink') && e('my-dynamic'); // 步骤3:测试dynamic类型block的moreLink生成
|
||||
r($blockTest->createMoreLinkTest($block4, 100)) && p('moreLink') && e('~~'); // 步骤4:测试未配置的block返回空moreLink
|
||||
r($blockTest->createMoreLinkTest($block5, 100)) && p('moreLink') && e('testtask-browse-type='); // 步骤5:测试testtask类型block的moreLink生成
|
||||
r($blockTest->createMoreLinkTest($block6, 100)) && p('moreLink') && e('my-testcase-type='); // 步骤6:测试带空type的case类型block的moreLink生成
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printAnnualWorkloadBlock();
|
||||
timeout=0
|
||||
cid=15247
|
||||
|
||||
- 步骤1:测试方法执行成功返回success为true属性success @1
|
||||
- 步骤2:测试返回maxStoryEstimate最大需求规模属性maxStoryEstimate @80
|
||||
- 步骤3:测试返回maxStoryCount最大需求数属性maxStoryCount @40
|
||||
- 步骤4:测试返回maxBugCount最大Bug数属性maxBugCount @15
|
||||
- 步骤5:测试返回对象包含所有必要属性
|
||||
- 属性success @1
|
||||
- 属性maxStoryEstimate @80
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. zendata数据准备
|
||||
$product = zenData('product');
|
||||
$product->id->range('1-5');
|
||||
$product->name->range('产品A,产品B,产品C,产品D,产品E');
|
||||
$product->code->range('producta,productb,productc,productd,producte');
|
||||
$product->status->range('normal{5}');
|
||||
$product->deleted->range('0{5}');
|
||||
$product->gen(5);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printAnnualWorkloadBlockTest()) && p('success') && e('1'); // 步骤1:测试方法执行成功返回success为true
|
||||
r($blockTest->printAnnualWorkloadBlockTest()) && p('maxStoryEstimate') && e('80'); // 步骤2:测试返回maxStoryEstimate最大需求规模
|
||||
r($blockTest->printAnnualWorkloadBlockTest()) && p('maxStoryCount') && e('40'); // 步骤3:测试返回maxStoryCount最大需求数
|
||||
r($blockTest->printAnnualWorkloadBlockTest()) && p('maxBugCount') && e('15'); // 步骤4:测试返回maxBugCount最大Bug数
|
||||
r($blockTest->printAnnualWorkloadBlockTest()) && p('success,maxStoryEstimate') && e('1,80'); // 步骤5:测试返回对象包含所有必要属性
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printBugBlock();
|
||||
timeout=0
|
||||
cid=15250
|
||||
|
||||
- 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
- 属性type @assignedTo
|
||||
- 属性count @10
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性type @invalid-type
|
||||
- 步骤3:测试count为0时的处理属性count @0
|
||||
- 步骤4:测试dashboard为my时projectID为0
|
||||
- 属性projectID @0
|
||||
- 属性dashboard @my
|
||||
- 步骤5:测试dashboard不为my时使用session中的projectID属性dashboard @project
|
||||
- 步骤6:测试不同的type类型参数
|
||||
- 属性type @openedBy
|
||||
- 属性count @8
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 准备测试数据
|
||||
$block1 = new stdclass();
|
||||
$block1->params = new stdclass();
|
||||
$block1->params->type = 'assignedTo';
|
||||
$block1->params->count = 10;
|
||||
$block1->params->orderBy = 'id_desc';
|
||||
$block1->dashboard = 'my';
|
||||
|
||||
$block2 = new stdclass();
|
||||
$block2->params = new stdclass();
|
||||
$block2->params->type = 'invalid-type';
|
||||
$block2->params->count = 10;
|
||||
$block2->dashboard = 'my';
|
||||
|
||||
$block3 = new stdclass();
|
||||
$block3->params = new stdclass();
|
||||
$block3->params->type = 'assignedTo';
|
||||
$block3->params->count = 0;
|
||||
$block3->dashboard = 'my';
|
||||
|
||||
$block4 = new stdclass();
|
||||
$block4->params = new stdclass();
|
||||
$block4->params->type = 'assignedTo';
|
||||
$block4->params->count = 5;
|
||||
$block4->dashboard = 'my';
|
||||
|
||||
$block5 = new stdclass();
|
||||
$block5->params = new stdclass();
|
||||
$block5->params->type = 'assignedTo';
|
||||
$block5->params->count = 5;
|
||||
$block5->dashboard = 'project';
|
||||
|
||||
$block6 = new stdclass();
|
||||
$block6->params = new stdclass();
|
||||
$block6->params->type = 'openedBy';
|
||||
$block6->params->count = 8;
|
||||
$block6->dashboard = 'my';
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printBugBlockTest($block1)) && p('type,count') && e('assignedTo,10'); // 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
r($blockTest->printBugBlockTest($block2)) && p('type') && e('invalid-type'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printBugBlockTest($block3)) && p('count') && e('0'); // 步骤3:测试count为0时的处理
|
||||
r($blockTest->printBugBlockTest($block4)) && p('projectID,dashboard') && e('0,my'); // 步骤4:测试dashboard为my时projectID为0
|
||||
r($blockTest->printBugBlockTest($block5)) && p('dashboard') && e('project'); // 步骤5:测试dashboard不为my时使用session中的projectID
|
||||
r($blockTest->printBugBlockTest($block6)) && p('type,count') && e('openedBy,8'); // 步骤6:测试不同的type类型参数
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printBugStatisticBlock();
|
||||
timeout=0
|
||||
cid=15251
|
||||
|
||||
- 执行blockTest模块的printBugStatisticBlockTest方法,参数是$normalBlock 属性totalBugs @10
|
||||
- 执行blockTest模块的printBugStatisticBlockTest方法,参数是$shadowBlock, $shadowParams 属性totalBugs @15
|
||||
- 执行blockTest模块的printBugStatisticBlockTest方法,参数是$emptyBlock 属性totalBugs @10
|
||||
- 执行blockTest模块的printBugStatisticBlockTest方法,参数是$stringZeroCountBlock 属性totalBugs @0
|
||||
- 执行blockTest模块的printBugStatisticBlockTest方法,参数是$statusBlock 属性totalBugs @10
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 准备基础测试数据
|
||||
$table = zenData('product');
|
||||
$table->id->range('1-8');
|
||||
$table->name->range('正常产品1,正常产品2,正常产品3,正常产品4,正常产品5,影子产品1,影子产品2,已关闭产品1');
|
||||
$table->code->range('product1,product2,product3,product4,product5,shadow1,shadow2,closed1');
|
||||
$table->status->range('normal{7},closed{1}');
|
||||
$table->shadow->range('0{5},1{2},0{1}');
|
||||
$table->deleted->range('0{8}');
|
||||
$table->gen(8);
|
||||
|
||||
su('admin');
|
||||
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 测试场景1:正常block对象,传入普通产品ID
|
||||
$normalBlock = new stdclass();
|
||||
$normalBlock->params = new stdclass();
|
||||
$normalBlock->params->type = '';
|
||||
$normalBlock->params->count = 10;
|
||||
|
||||
// 测试场景2:影子产品测试
|
||||
$shadowBlock = new stdclass();
|
||||
$shadowBlock->params = new stdclass();
|
||||
$shadowBlock->params->type = '';
|
||||
$shadowBlock->params->count = 10;
|
||||
$shadowParams = array('active' => 6);
|
||||
|
||||
// 测试场景3:空block对象
|
||||
$emptyBlock = new stdclass();
|
||||
|
||||
// 测试场景4:count为字符串'0'的block对象
|
||||
$stringZeroCountBlock = new stdclass();
|
||||
$stringZeroCountBlock->params = new stdclass();
|
||||
$stringZeroCountBlock->params->type = '';
|
||||
$stringZeroCountBlock->params->count = '0';
|
||||
|
||||
// 测试场景5:按状态过滤的block对象
|
||||
$statusBlock = new stdclass();
|
||||
$statusBlock->params = new stdclass();
|
||||
$statusBlock->params->type = 'normal';
|
||||
$statusBlock->params->count = 10;
|
||||
|
||||
// 步骤1:正常情况测试 - 验证普通产品的Bug总数
|
||||
r($blockTest->printBugStatisticBlockTest($normalBlock)) && p('totalBugs') && e('10');
|
||||
// 步骤2:影子产品测试 - 验证影子产品的Bug总数
|
||||
r($blockTest->printBugStatisticBlockTest($shadowBlock, $shadowParams)) && p('totalBugs') && e('15');
|
||||
// 步骤3:空对象测试 - 验证默认选择第一个产品
|
||||
r($blockTest->printBugStatisticBlockTest($emptyBlock)) && p('totalBugs') && e('10');
|
||||
// 步骤4:count为字符串'0'测试 - 验证count为'0'时Bug总数为0
|
||||
r($blockTest->printBugStatisticBlockTest($stringZeroCountBlock)) && p('totalBugs') && e('0');
|
||||
// 步骤5:按状态过滤测试 - 验证按normal状态过滤后的Bug总数
|
||||
r($blockTest->printBugStatisticBlockTest($statusBlock)) && p('totalBugs') && e('10');
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printBuildBlock();
|
||||
timeout=0
|
||||
cid=15252
|
||||
|
||||
- 执行blockTest模块的printBuildBlockTest方法,参数是$block1 属性count @0
|
||||
- 执行blockTest模块的printBuildBlockTest方法,参数是$block2 属性count @0
|
||||
- 执行blockTest模块的printBuildBlockTest方法,参数是$block3 属性count @0
|
||||
- 执行blockTest模块的printBuildBlockTest方法,参数是$block4 属性count @0
|
||||
- 执行blockTest模块的printBuildBlockTest方法,参数是$block5 属性count @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
$build = zenData('build');
|
||||
$build->id->range('1-20');
|
||||
$build->project->range('1-10');
|
||||
$build->product->range('1-10');
|
||||
$build->execution->range('1-20');
|
||||
$build->name->range('Build `1-20`');
|
||||
$build->deleted->range('0');
|
||||
$build->gen(20);
|
||||
|
||||
zenData('product')->loadYaml('product')->gen(10);
|
||||
zenData('project')->loadYaml('project')->gen(10);
|
||||
zenData('user')->loadYaml('user')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
$block1 = new stdClass();
|
||||
$block1->dashboard = 'my';
|
||||
$block1->params = new stdClass();
|
||||
$block1->params->count = 15;
|
||||
|
||||
$block2 = new stdClass();
|
||||
$block2->dashboard = 'my';
|
||||
$block2->params = new stdClass();
|
||||
$block2->params->count = 10;
|
||||
|
||||
$block3 = new stdClass();
|
||||
$block3->dashboard = 'my';
|
||||
$block3->params = new stdClass();
|
||||
$block3->params->count = 15;
|
||||
|
||||
$block4 = new stdClass();
|
||||
$block4->dashboard = 'my';
|
||||
$block4->params = new stdClass();
|
||||
$block4->params->count = 15;
|
||||
|
||||
$block5 = new stdClass();
|
||||
$block5->dashboard = 'project';
|
||||
$block5->params = new stdClass();
|
||||
$block5->params->count = 15;
|
||||
|
||||
r($blockTest->printBuildBlockTest($block1)) && p('count') && e('0');
|
||||
r($blockTest->printBuildBlockTest($block2)) && p('count') && e('0');
|
||||
su('user1');
|
||||
r($blockTest->printBuildBlockTest($block3)) && p('count') && e('0');
|
||||
su('admin');
|
||||
r($blockTest->printBuildBlockTest($block4)) && p('count') && e('0');
|
||||
global $tester;
|
||||
$tester->session->set('project', 1);
|
||||
r($blockTest->printBuildBlockTest($block5)) && p('count') && e('0');
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printExecutionListBlock();
|
||||
timeout=0
|
||||
cid=15261
|
||||
|
||||
- 测试count为5时返回5条执行记录属性hasExecutions @true
|
||||
- 测试count为3时返回成功属性success @1
|
||||
- 测试type为all时正常返回执行记录属性success @1
|
||||
- 测试type为wait时返回成功属性success @1
|
||||
- 测试type为doing时返回成功属性success @1
|
||||
- 测试type包含非法字符时返回空结果属性hasExecutions @false
|
||||
- 测试count为0时使用默认值返回执行记录属性hasExecutions @true
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
zenData('user')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$blockTest = new blockTest();
|
||||
|
||||
$block1 = new stdClass();
|
||||
$block1->params = new stdClass();
|
||||
$block1->params->count = 5;
|
||||
$block1->params->type = 'all';
|
||||
|
||||
$block2 = new stdClass();
|
||||
$block2->params = new stdClass();
|
||||
$block2->params->count = 3;
|
||||
$block2->params->type = 'all';
|
||||
|
||||
$block3 = new stdClass();
|
||||
$block3->params = new stdClass();
|
||||
$block3->params->count = 4;
|
||||
$block3->params->type = 'all';
|
||||
|
||||
$block4 = new stdClass();
|
||||
$block4->params = new stdClass();
|
||||
$block4->params->count = 4;
|
||||
$block4->params->type = 'wait';
|
||||
|
||||
$block5 = new stdClass();
|
||||
$block5->params = new stdClass();
|
||||
$block5->params->count = 4;
|
||||
$block5->params->type = 'doing';
|
||||
|
||||
$block6 = new stdClass();
|
||||
$block6->params = new stdClass();
|
||||
$block6->params->count = 10;
|
||||
$block6->params->type = 'all; DROP TABLE';
|
||||
|
||||
$block7 = new stdClass();
|
||||
$block7->params = new stdClass();
|
||||
$block7->params->count = 0;
|
||||
$block7->params->type = 'all';
|
||||
|
||||
r($blockTest->printExecutionListBlockTest($block1)) && p('hasExecutions') && e('true'); // 测试count为5时返回5条执行记录
|
||||
r($blockTest->printExecutionListBlockTest($block2)) && p('success') && e('1'); // 测试count为3时返回成功
|
||||
r($blockTest->printExecutionListBlockTest($block3)) && p('success') && e('1'); // 测试type为all时正常返回执行记录
|
||||
r($blockTest->printExecutionListBlockTest($block4)) && p('success') && e('1'); // 测试type为wait时返回成功
|
||||
r($blockTest->printExecutionListBlockTest($block5)) && p('success') && e('1'); // 测试type为doing时返回成功
|
||||
r($blockTest->printExecutionListBlockTest($block6)) && p('hasExecutions') && e('false'); // 测试type包含非法字符时返回空结果
|
||||
r($blockTest->printExecutionListBlockTest($block7)) && p('hasExecutions') && e('true'); // 测试count为0时使用默认值返回执行记录
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printExecutionStatisticBlock();
|
||||
timeout=0
|
||||
cid=15263
|
||||
|
||||
- 执行blockTest模块的printExecutionStatisticBlockTest方法,参数是$block1
|
||||
- 属性executionsCount @0
|
||||
- 属性projectsCount @3
|
||||
- 属性hasChartData @1
|
||||
- 执行blockTest模块的printExecutionStatisticBlockTest方法,参数是$block2
|
||||
- 属性executionsCount @0
|
||||
- 属性projectsCount @3
|
||||
- 属性hasChartData @1
|
||||
- 执行blockTest模块的printExecutionStatisticBlockTest方法,参数是$block3
|
||||
- 属性executionsCount @0
|
||||
- 属性projectsCount @3
|
||||
- 属性hasChartData @1
|
||||
- 执行blockTest模块的printExecutionStatisticBlockTest方法,参数是$block4
|
||||
- 属性executionsCount @0
|
||||
- 属性projectsCount @3
|
||||
- 属性hasChartData @1
|
||||
- 属性currentProjectID @0
|
||||
- 执行blockTest模块的printExecutionStatisticBlockTest方法,参数是$block5
|
||||
- 属性executionsCount @0
|
||||
- 属性projectsCount @3
|
||||
- 属性hasChartData @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
zendata('project')->loadYaml('project', false, 2)->gen(20);
|
||||
zendata('product')->loadYaml('product', false, 2)->gen(10);
|
||||
zendata('projectproduct')->loadYaml('projectproduct', false, 2)->gen(10);
|
||||
|
||||
su('admin');
|
||||
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
$block1 = new stdClass();
|
||||
$block1->id = 1;
|
||||
$block1->dashboard = 'my';
|
||||
$block1->params = new stdClass();
|
||||
$block1->params->type = 'undone';
|
||||
$block1->params->count = 5;
|
||||
|
||||
$block2 = new stdClass();
|
||||
$block2->id = 2;
|
||||
$block2->dashboard = 'my';
|
||||
$block2->params = new stdClass();
|
||||
$block2->params->type = 'done';
|
||||
$block2->params->count = 5;
|
||||
|
||||
$block3 = new stdClass();
|
||||
$block3->id = 3;
|
||||
$block3->dashboard = 'my';
|
||||
$block3->params = new stdClass();
|
||||
$block3->params->type = 'all';
|
||||
$block3->params->count = 10;
|
||||
|
||||
$block4 = new stdClass();
|
||||
$block4->id = 4;
|
||||
$block4->dashboard = 'project';
|
||||
$block4->params = new stdClass();
|
||||
$block4->params->type = 'undone';
|
||||
$block4->params->count = 5;
|
||||
|
||||
$block5 = new stdClass();
|
||||
$block5->id = 5;
|
||||
$block5->dashboard = 'my';
|
||||
$block5->params = new stdClass();
|
||||
$block5->params->type = 'undone';
|
||||
$block5->params->count = 0;
|
||||
|
||||
r($blockTest->printExecutionStatisticBlockTest($block1)) && p('executionsCount,projectsCount,hasChartData') && e('0,3,1');
|
||||
r($blockTest->printExecutionStatisticBlockTest($block2)) && p('executionsCount,projectsCount,hasChartData') && e('0,3,1');
|
||||
r($blockTest->printExecutionStatisticBlockTest($block3)) && p('executionsCount,projectsCount,hasChartData') && e('0,3,1');
|
||||
r($blockTest->printExecutionStatisticBlockTest($block4)) && p('executionsCount,projectsCount,hasChartData,currentProjectID') && e('0,3,1,0');
|
||||
r($blockTest->printExecutionStatisticBlockTest($block5)) && p('executionsCount,projectsCount,hasChartData') && e('0,3,1');
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printIssueBlock();
|
||||
timeout=0
|
||||
cid=15265
|
||||
|
||||
- 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
- 属性type @active
|
||||
- 属性count @5
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性hasValidation @0
|
||||
- 步骤3:测试count为0时的处理属性count @0
|
||||
- 步骤4:测试projectID为0时的处理
|
||||
- 属性type @resolved
|
||||
- 属性projectID @0
|
||||
- 步骤5:测试不同projectID和count参数
|
||||
- 属性type @active
|
||||
- 属性count @8
|
||||
- 步骤6:测试不同的type类型参数
|
||||
- 属性type @closed
|
||||
- 属性count @10
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printIssueBlockTest('active', 1, 5, 'id_desc', 'html')) && p('type,count') && e('active,5'); // 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
r($blockTest->printIssueBlockTest('invalid-type', 1, 5, 'id_desc', 'html')) && p('hasValidation') && e('0'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printIssueBlockTest('active', 1, 0, 'id_desc', 'html')) && p('count') && e('0'); // 步骤3:测试count为0时的处理
|
||||
r($blockTest->printIssueBlockTest('resolved', 0, 5, 'id_desc', 'html')) && p('type,projectID') && e('resolved,0'); // 步骤4:测试projectID为0时的处理
|
||||
r($blockTest->printIssueBlockTest('active', 2, 8, 'id_desc', 'html')) && p('type,count') && e('active,8'); // 步骤5:测试不同projectID和count参数
|
||||
r($blockTest->printIssueBlockTest('closed', 1, 10, 'id_desc', 'html')) && p('type,count') && e('closed,10'); // 步骤6:测试不同的type类型参数
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printPlanBlock();
|
||||
timeout=0
|
||||
cid=15268
|
||||
|
||||
- 步骤1:默认参数测试属性plansCount @1
|
||||
- 步骤2:type为all类型测试属性plansCount @1
|
||||
- 步骤3:count限制为5测试属性plansCount @1
|
||||
- 步骤4:count限制为10测试属性plansCount @1
|
||||
- 步骤5:type为noproduct测试属性plansCount @1
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
// 暂时注释掉zendata,直接测试逻辑
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
// 创建默认的block参数
|
||||
$defaultBlock = new stdclass();
|
||||
$defaultBlock->dashboard = 'my';
|
||||
$defaultBlock->params = new stdclass();
|
||||
$defaultBlock->params->type = '';
|
||||
$defaultBlock->params->count = 15;
|
||||
|
||||
r($blockTest->printPlanBlockTest($defaultBlock)) && p('plansCount') && e('1'); // 步骤1:默认参数测试
|
||||
|
||||
// 测试type为all的情况
|
||||
$allBlock = new stdclass();
|
||||
$allBlock->dashboard = 'my';
|
||||
$allBlock->params = new stdclass();
|
||||
$allBlock->params->type = 'all';
|
||||
$allBlock->params->count = 15;
|
||||
|
||||
r($blockTest->printPlanBlockTest($allBlock)) && p('plansCount') && e('1'); // 步骤2:type为all类型测试
|
||||
|
||||
// 测试count限制为5
|
||||
$limit5Block = new stdclass();
|
||||
$limit5Block->dashboard = 'my';
|
||||
$limit5Block->params = new stdclass();
|
||||
$limit5Block->params->type = '';
|
||||
$limit5Block->params->count = 5;
|
||||
|
||||
r($blockTest->printPlanBlockTest($limit5Block)) && p('plansCount') && e('1'); // 步骤3:count限制为5测试
|
||||
|
||||
// 测试count限制为10
|
||||
$limit10Block = new stdclass();
|
||||
$limit10Block->dashboard = 'my';
|
||||
$limit10Block->params = new stdclass();
|
||||
$limit10Block->params->type = '';
|
||||
$limit10Block->params->count = 10;
|
||||
|
||||
r($blockTest->printPlanBlockTest($limit10Block)) && p('plansCount') && e('1'); // 步骤4:count限制为10测试
|
||||
|
||||
// 测试type为noproduct的情况
|
||||
$noproductBlock = new stdclass();
|
||||
$noproductBlock->dashboard = 'my';
|
||||
$noproductBlock->params = new stdclass();
|
||||
$noproductBlock->params->type = 'noproduct';
|
||||
$noproductBlock->params->count = 15;
|
||||
|
||||
r($blockTest->printPlanBlockTest($noproductBlock)) && p('plansCount') && e('1'); // 步骤5:type为noproduct测试
|
||||
@@ -1,77 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printProjectStatisticBlock();
|
||||
timeout=0
|
||||
cid=15277
|
||||
|
||||
- 步骤1:标准区块对象正常获取项目统计数据属性projectCount @10
|
||||
- 步骤2:验证用户数量正确加载属性userCount @11
|
||||
- 步骤3:使用type为wait过滤项目状态属性projectCount @3
|
||||
- 步骤4:设置count为5限制项目数量属性projectCount @5
|
||||
- 步骤5:使用type为doing过滤项目状态属性projectCount @3
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
// 2. zendata数据准备
|
||||
$project = zenData('project');
|
||||
$project->id->range('1-20');
|
||||
$project->name->range('项目{1-20}');
|
||||
$project->status->range('wait{5},doing{5},suspended{5},closed{5}');
|
||||
$project->type->range('project');
|
||||
$project->model->range('scrum');
|
||||
$project->PM->range('admin,user1,user2,user3,user4');
|
||||
$project->deleted->range('0');
|
||||
$project->gen(20);
|
||||
|
||||
$user = zenData('user');
|
||||
$user->id->range('1-10');
|
||||
$user->account->range('admin,user1,user2,user3,user4,user5,user6,user7,user8,user9');
|
||||
$user->realname->range('管理员,用户1,用户2,用户3,用户4,用户5,用户6,用户7,用户8,用户9');
|
||||
$user->deleted->range('0');
|
||||
$user->gen(10);
|
||||
|
||||
// 3. 用户登录
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
// 5. 创建测试数据对象
|
||||
$block1 = new stdclass();
|
||||
$block1->params = new stdclass();
|
||||
$block1->params->type = 'all';
|
||||
$block1->params->count = 15;
|
||||
|
||||
$block2 = new stdclass();
|
||||
$block2->params = new stdclass();
|
||||
$block2->params->type = 'all';
|
||||
$block2->params->count = 15;
|
||||
|
||||
$block3 = new stdclass();
|
||||
$block3->params = new stdclass();
|
||||
$block3->params->type = 'wait';
|
||||
$block3->params->count = 15;
|
||||
|
||||
$block4 = new stdclass();
|
||||
$block4->params = new stdclass();
|
||||
$block4->params->type = 'all';
|
||||
$block4->params->count = 5;
|
||||
|
||||
$block5 = new stdclass();
|
||||
$block5->params = new stdclass();
|
||||
$block5->params->type = 'doing';
|
||||
$block5->params->count = 15;
|
||||
|
||||
// 6. 必须包含至少5个测试步骤
|
||||
r($blockTest->printProjectStatisticBlockTest($block1)) && p('projectCount') && e('10'); // 步骤1:标准区块对象正常获取项目统计数据
|
||||
r($blockTest->printProjectStatisticBlockTest($block2)) && p('userCount') && e('11'); // 步骤2:验证用户数量正确加载
|
||||
r($blockTest->printProjectStatisticBlockTest($block3)) && p('projectCount') && e('3'); // 步骤3:使用type为wait过滤项目状态
|
||||
r($blockTest->printProjectStatisticBlockTest($block4)) && p('projectCount') && e('5'); // 步骤4:设置count为5限制项目数量
|
||||
r($blockTest->printProjectStatisticBlockTest($block5)) && p('projectCount') && e('3'); // 步骤5:使用type为doing过滤项目状态
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printRiskBlock();
|
||||
timeout=0
|
||||
cid=15284
|
||||
|
||||
- 步骤1:测试默认参数情况 @1
|
||||
- 步骤2:测试type为all,count为15 @1
|
||||
- 步骤3:测试type为active,count为5 @1
|
||||
- 步骤4:测试type为closed,count为10 @1
|
||||
- 步骤5:测试type为resolved,count为20 @1
|
||||
- 步骤6:测试参数结构不正确 @0
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 创建测试用的block对象
|
||||
$block1 = new stdClass();
|
||||
$block1->params = new stdClass();
|
||||
$block1->params->type = 'all';
|
||||
$block1->params->count = 15;
|
||||
$block1->params->orderBy = 'id_desc';
|
||||
|
||||
$block2 = new stdClass();
|
||||
$block2->params = new stdClass();
|
||||
$block2->params->type = 'active';
|
||||
$block2->params->count = 5;
|
||||
$block2->params->orderBy = 'id_desc';
|
||||
|
||||
$block3 = new stdClass();
|
||||
$block3->params = new stdClass();
|
||||
$block3->params->type = 'closed';
|
||||
$block3->params->count = 10;
|
||||
$block3->params->orderBy = 'id_asc';
|
||||
|
||||
$block4 = new stdClass();
|
||||
$block4->params = new stdClass();
|
||||
$block4->params->type = 'resolved';
|
||||
$block4->params->count = 20;
|
||||
$block4->params->orderBy = 'name_desc';
|
||||
|
||||
$block5 = new stdClass();
|
||||
// 故意不设置params,测试参数不正确的情况
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printRiskBlockTest(null)) && p() && e('1'); // 步骤1:测试默认参数情况
|
||||
r($blockTest->printRiskBlockTest($block1)) && p() && e('1'); // 步骤2:测试type为all,count为15
|
||||
r($blockTest->printRiskBlockTest($block2)) && p() && e('1'); // 步骤3:测试type为active,count为5
|
||||
r($blockTest->printRiskBlockTest($block3)) && p() && e('1'); // 步骤4:测试type为closed,count为10
|
||||
r($blockTest->printRiskBlockTest($block4)) && p() && e('1'); // 步骤5:测试type为resolved,count为20
|
||||
r($blockTest->printRiskBlockTest($block5)) && p() && e('0'); // 步骤6:测试参数结构不正确
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printScrumIssueBlock();
|
||||
timeout=0
|
||||
cid=15286
|
||||
|
||||
- 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
- 属性type @active
|
||||
- 属性count @5
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性hasValidation @0
|
||||
- 步骤3:测试count为0时的处理属性count @0
|
||||
- 步骤4:测试projectID为0时的处理
|
||||
- 属性type @resolved
|
||||
- 属性projectID @0
|
||||
- 步骤5:测试不同projectID和count参数
|
||||
- 属性type @active
|
||||
- 属性count @8
|
||||
- 步骤6:测试不同的type类型参数
|
||||
- 属性type @closed
|
||||
- 属性count @10
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printScrumIssueBlockTest('active', 1, 5, 'id_desc', 'html')) && p('type,count') && e('active,5'); // 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
r($blockTest->printScrumIssueBlockTest('invalid-type', 1, 5, 'id_desc', 'html')) && p('hasValidation') && e('0'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printScrumIssueBlockTest('active', 1, 0, 'id_desc', 'html')) && p('count') && e('0'); // 步骤3:测试count为0时的处理
|
||||
r($blockTest->printScrumIssueBlockTest('resolved', 0, 5, 'id_desc', 'html')) && p('type,projectID') && e('resolved,0'); // 步骤4:测试projectID为0时的处理
|
||||
r($blockTest->printScrumIssueBlockTest('active', 2, 8, 'id_desc', 'html')) && p('type,count') && e('active,8'); // 步骤5:测试不同projectID和count参数
|
||||
r($blockTest->printScrumIssueBlockTest('closed', 1, 10, 'id_desc', 'html')) && p('type,count') && e('closed,10'); // 步骤6:测试不同的type类型参数
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printScrumIssueBlock();
|
||||
timeout=0
|
||||
cid=15287
|
||||
|
||||
- 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
- 属性type @active
|
||||
- 属性count @5
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性hasValidation @0
|
||||
- 步骤3:测试count为0时的处理属性count @0
|
||||
- 步骤4:测试projectID为0时的处理
|
||||
- 属性type @resolved
|
||||
- 属性projectID @0
|
||||
- 步骤5:测试不同projectID和count参数
|
||||
- 属性type @active
|
||||
- 属性count @8
|
||||
- 步骤6:测试不同的type类型参数
|
||||
- 属性type @closed
|
||||
- 属性count @10
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printScrumIssueBlockTest('active', 1, 5, 'id_desc', 'html')) && p('type,count') && e('active,5'); // 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
r($blockTest->printScrumIssueBlockTest('invalid-type', 1, 5, 'id_desc', 'html')) && p('hasValidation') && e('0'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printScrumIssueBlockTest('active', 1, 0, 'id_desc', 'html')) && p('count') && e('0'); // 步骤3:测试count为0时的处理
|
||||
r($blockTest->printScrumIssueBlockTest('resolved', 0, 5, 'id_desc', 'html')) && p('type,projectID') && e('resolved,0'); // 步骤4:测试projectID为0时的处理
|
||||
r($blockTest->printScrumIssueBlockTest('active', 2, 8, 'id_desc', 'html')) && p('type,count') && e('active,8'); // 步骤5:测试不同projectID和count参数
|
||||
r($blockTest->printScrumIssueBlockTest('closed', 1, 10, 'id_desc', 'html')) && p('type,count') && e('closed,10'); // 步骤6:测试不同的type类型参数
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printScrumListBlock();
|
||||
timeout=0
|
||||
cid=15288
|
||||
|
||||
- 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
- 属性type @undone
|
||||
- 属性count @15
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性hasValidation @0
|
||||
- 步骤3:测试count为0时的处理属性count @0
|
||||
- 步骤4:测试projectID为0时的处理
|
||||
- 属性type @all
|
||||
- 属性projectID @0
|
||||
- 步骤5:测试不同projectID和count参数
|
||||
- 属性type @doing
|
||||
- 属性count @20
|
||||
- 步骤6:测试不同的type类型参数
|
||||
- 属性type @done
|
||||
- 属性count @10
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printScrumListBlockTest('undone', 1, 15)) && p('type,count') && e('undone,15'); // 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
r($blockTest->printScrumListBlockTest('invalid-type', 1, 5)) && p('hasValidation') && e('0'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printScrumListBlockTest('undone', 1, 0)) && p('count') && e('0'); // 步骤3:测试count为0时的处理
|
||||
r($blockTest->printScrumListBlockTest('all', 0, 5)) && p('type,projectID') && e('all,0'); // 步骤4:测试projectID为0时的处理
|
||||
r($blockTest->printScrumListBlockTest('doing', 2, 20)) && p('type,count') && e('doing,20'); // 步骤5:测试不同projectID和count参数
|
||||
r($blockTest->printScrumListBlockTest('done', 1, 10)) && p('type,count') && e('done,10'); // 步骤6:测试不同的type类型参数
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printScrumRiskBlock();
|
||||
timeout=0
|
||||
cid=15291
|
||||
|
||||
- 步骤1:测试默认参数情况 @1
|
||||
- 步骤2:测试type为all,count为15 @1
|
||||
- 步骤3:测试type为active,count为5 @1
|
||||
- 步骤4:测试type为closed,count为10 @1
|
||||
- 步骤5:测试type为resolved,count为20 @1
|
||||
- 步骤6:测试参数结构不正确 @0
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 创建测试用的block对象
|
||||
$block1 = new stdClass();
|
||||
$block1->params = new stdClass();
|
||||
$block1->params->type = 'all';
|
||||
$block1->params->count = 15;
|
||||
$block1->params->orderBy = 'id_desc';
|
||||
|
||||
$block2 = new stdClass();
|
||||
$block2->params = new stdClass();
|
||||
$block2->params->type = 'active';
|
||||
$block2->params->count = 5;
|
||||
$block2->params->orderBy = 'id_desc';
|
||||
|
||||
$block3 = new stdClass();
|
||||
$block3->params = new stdClass();
|
||||
$block3->params->type = 'closed';
|
||||
$block3->params->count = 10;
|
||||
$block3->params->orderBy = 'id_asc';
|
||||
|
||||
$block4 = new stdClass();
|
||||
$block4->params = new stdClass();
|
||||
$block4->params->type = 'resolved';
|
||||
$block4->params->count = 20;
|
||||
$block4->params->orderBy = 'name_desc';
|
||||
|
||||
$block5 = new stdClass();
|
||||
// 故意不设置params,测试参数不正确的情况
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printScrumRiskBlockTest(null)) && p() && e('1'); // 步骤1:测试默认参数情况
|
||||
r($blockTest->printScrumRiskBlockTest($block1)) && p() && e('1'); // 步骤2:测试type为all,count为15
|
||||
r($blockTest->printScrumRiskBlockTest($block2)) && p() && e('1'); // 步骤3:测试type为active,count为5
|
||||
r($blockTest->printScrumRiskBlockTest($block3)) && p() && e('1'); // 步骤4:测试type为closed,count为10
|
||||
r($blockTest->printScrumRiskBlockTest($block4)) && p() && e('1'); // 步骤5:测试type为resolved,count为20
|
||||
r($blockTest->printScrumRiskBlockTest($block5)) && p() && e('0'); // 步骤6:测试参数结构不正确
|
||||
@@ -1,123 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printScrumTestBlock();
|
||||
timeout=0
|
||||
cid=15293
|
||||
|
||||
- 步骤1:测试正常情况下传入type=all和count=5的参数
|
||||
- 属性type @all
|
||||
- 属性projectID @1
|
||||
- 步骤2:测试type=wait时获取wait状态的测试单
|
||||
- 属性type @wait
|
||||
- 属性projectID @1
|
||||
- 步骤3:测试type=doing时获取doing状态的测试单
|
||||
- 属性type @doing
|
||||
- 属性projectID @1
|
||||
- 步骤4:测试type=done时获取done状态的测试单
|
||||
- 属性type @done
|
||||
- 属性projectID @1
|
||||
- 步骤5:测试type=blocked时获取blocked状态的测试单
|
||||
- 属性type @blocked
|
||||
- 属性projectID @1
|
||||
- 步骤6:测试count=10时限制返回数量
|
||||
- 属性type @all
|
||||
- 属性projectID @1
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$project = zenData('project');
|
||||
$project->id->range('1-10');
|
||||
$project->name->range('项目1,项目2,项目3,项目4,项目5');
|
||||
$project->type->range('project');
|
||||
$project->status->range('doing');
|
||||
$project->model->range('scrum');
|
||||
$project->deleted->range('0');
|
||||
$project->gen(5);
|
||||
|
||||
$product = zenData('product');
|
||||
$product->id->range('1-10');
|
||||
$product->name->range('产品1,产品2,产品3,产品4,产品5');
|
||||
$product->type->range('normal');
|
||||
$product->status->range('normal');
|
||||
$product->deleted->range('0');
|
||||
$product->gen(5);
|
||||
|
||||
$build = zenData('build');
|
||||
$build->id->range('1-20');
|
||||
$build->name->range('版本1,版本2,版本3,版本4,版本5');
|
||||
$build->product->range('1-5');
|
||||
$build->execution->range('1-5');
|
||||
$build->deleted->range('0');
|
||||
$build->gen(10);
|
||||
|
||||
$projectProduct = zenData('projectproduct');
|
||||
$projectProduct->project->range('1{5},2{5},3{5},4{5},5{5}');
|
||||
$projectProduct->product->range('1,2,3,4,5');
|
||||
$projectProduct->gen(25);
|
||||
|
||||
$testtask = zenData('testtask');
|
||||
$testtask->id->range('1-50');
|
||||
$testtask->project->range('1');
|
||||
$testtask->product->range('1,2,3,4,5');
|
||||
$testtask->execution->range('1-5');
|
||||
$testtask->name->range('测试单1,测试单2,测试单3,测试单4,测试单5');
|
||||
$testtask->build->range('1-10');
|
||||
$testtask->status->range('wait{10},doing{10},done{10},blocked{10}');
|
||||
$testtask->auto->range('no');
|
||||
$testtask->deleted->range('0');
|
||||
$testtask->gen(40);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
// 设置session.project
|
||||
global $tester;
|
||||
$tester->session->set('project', 1);
|
||||
|
||||
// 5. 🔴 强制要求:必须包含至少5个测试步骤
|
||||
$block1 = new stdClass();
|
||||
$block1->params = new stdClass();
|
||||
$block1->params->type = 'all';
|
||||
$block1->params->count = 5;
|
||||
r($blockTest->printScrumTestBlockTest($block1)) && p('type,projectID') && e('all,1'); // 步骤1:测试正常情况下传入type=all和count=5的参数
|
||||
|
||||
$block2 = new stdClass();
|
||||
$block2->params = new stdClass();
|
||||
$block2->params->type = 'wait';
|
||||
$block2->params->count = 10;
|
||||
r($blockTest->printScrumTestBlockTest($block2)) && p('type,projectID') && e('wait,1'); // 步骤2:测试type=wait时获取wait状态的测试单
|
||||
|
||||
$block3 = new stdClass();
|
||||
$block3->params = new stdClass();
|
||||
$block3->params->type = 'doing';
|
||||
$block3->params->count = 10;
|
||||
r($blockTest->printScrumTestBlockTest($block3)) && p('type,projectID') && e('doing,1'); // 步骤3:测试type=doing时获取doing状态的测试单
|
||||
|
||||
$block4 = new stdClass();
|
||||
$block4->params = new stdClass();
|
||||
$block4->params->type = 'done';
|
||||
$block4->params->count = 10;
|
||||
r($blockTest->printScrumTestBlockTest($block4)) && p('type,projectID') && e('done,1'); // 步骤4:测试type=done时获取done状态的测试单
|
||||
|
||||
$block5 = new stdClass();
|
||||
$block5->params = new stdClass();
|
||||
$block5->params->type = 'blocked';
|
||||
$block5->params->count = 10;
|
||||
r($blockTest->printScrumTestBlockTest($block5)) && p('type,projectID') && e('blocked,1'); // 步骤5:测试type=blocked时获取blocked状态的测试单
|
||||
|
||||
$block6 = new stdClass();
|
||||
$block6->params = new stdClass();
|
||||
$block6->params->type = 'all';
|
||||
$block6->params->count = 10;
|
||||
r($blockTest->printScrumTestBlockTest($block6)) && p('type,projectID') && e('all,1'); // 步骤6:测试count=10时限制返回数量
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printSingleDynamicBlock();
|
||||
timeout=0
|
||||
cid=15296
|
||||
|
||||
- 执行blockTest模块的printSingleDynamicBlockTest方法 属性productID @1
|
||||
- 执行blockTest模块的printSingleDynamicBlockTest方法
|
||||
- 属性productID @999
|
||||
- 属性actionsCount @0
|
||||
- 执行blockTest模块的printSingleDynamicBlockTest方法 属性productID @0
|
||||
- 执行blockTest模块的printSingleDynamicBlockTest方法 属性usersCount @11
|
||||
- 执行blockTest模块的printSingleDynamicBlockTest方法 属性productID @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
zenData('product')->loadYaml('product', false, 2)->gen(10);
|
||||
zenData('user')->gen(10);
|
||||
zenData('action')->loadYaml('action', false, 2)->gen(50);
|
||||
|
||||
su('admin');
|
||||
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
global $app;
|
||||
$app->session->set('product', 1);
|
||||
r($blockTest->printSingleDynamicBlockTest()) && p('productID') && e('1');
|
||||
$app->session->set('product', 999);
|
||||
r($blockTest->printSingleDynamicBlockTest()) && p('productID,actionsCount') && e('999,0');
|
||||
$app->session->set('product', 0);
|
||||
r($blockTest->printSingleDynamicBlockTest()) && p('productID') && e('0');
|
||||
$app->session->set('product', 1);
|
||||
r($blockTest->printSingleDynamicBlockTest()) && p('usersCount') && e('11');
|
||||
$app->session->set('product', 1);
|
||||
r($blockTest->printSingleDynamicBlockTest()) && p('productID') && e('1');
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printSprintBlock();
|
||||
timeout=0
|
||||
cid=15303
|
||||
|
||||
- 步骤1:测试默认block对象生成groups数据 @2
|
||||
- 步骤2:测试返回结果包含cards组属性type @cards
|
||||
- 步骤3:测试返回结果包含barChart组属性type @barChart
|
||||
- 步骤4:测试cards组包含2个卡片 @2
|
||||
- 步骤5:测试barChart组包含3个柱状图 @3
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$metriclib = zenData('metriclib');
|
||||
$metriclib->id->range('1-20');
|
||||
$metriclib->metricCode->range('count_of_execution,count_of_annual_finished_execution,count_wait_execution,count_of_doing_execution,count_of_suspended_execution');
|
||||
$metriclib->value->range('10-50');
|
||||
$metriclib->date->range('2024-01-01:2024-12-31');
|
||||
$metriclib->year->range('2024');
|
||||
$metriclib->month->range('01-12');
|
||||
$metriclib->gen(20);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 5. 🔴 强制要求:必须包含至少5个测试步骤
|
||||
r(count($blockTest->printSprintBlockTest()->groups)) && p() && e('2'); // 步骤1:测试默认block对象生成groups数据
|
||||
r($blockTest->printSprintBlockTest()->groups[0]) && p('type') && e('cards'); // 步骤2:测试返回结果包含cards组
|
||||
r($blockTest->printSprintBlockTest()->groups[1]) && p('type') && e('barChart'); // 步骤3:测试返回结果包含barChart组
|
||||
r(count($blockTest->printSprintBlockTest()->groups[0]->cards)) && p() && e('2'); // 步骤4:测试cards组包含2个卡片
|
||||
r(count($blockTest->printSprintBlockTest()->groups[1]->bars)) && p() && e('3'); // 步骤5:测试barChart组包含3个柱状图
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printTaskBlock();
|
||||
timeout=0
|
||||
cid=15305
|
||||
|
||||
- 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
- 属性type @assignedTo
|
||||
- 属性count @10
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性type @invalid-type
|
||||
- 步骤3:测试count为0时的处理属性count @0
|
||||
- 步骤4:测试不同的type类型参数finishedBy
|
||||
- 属性type @finishedBy
|
||||
- 属性count @8
|
||||
- 步骤5:测试orderBy参数的传递
|
||||
- 属性orderBy @id_asc
|
||||
- 属性type @assignedTo
|
||||
- 步骤6:测试较大的count值 @5
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 准备测试数据
|
||||
$block1 = new stdclass();
|
||||
$block1->params = new stdclass();
|
||||
$block1->params->type = 'assignedTo';
|
||||
$block1->params->count = 10;
|
||||
$block1->params->orderBy = 'id_desc';
|
||||
$block1->dashboard = 'my';
|
||||
|
||||
$block2 = new stdclass();
|
||||
$block2->params = new stdclass();
|
||||
$block2->params->type = 'invalid-type';
|
||||
$block2->params->count = 10;
|
||||
$block2->dashboard = 'my';
|
||||
|
||||
$block3 = new stdclass();
|
||||
$block3->params = new stdclass();
|
||||
$block3->params->type = 'assignedTo';
|
||||
$block3->params->count = 0;
|
||||
$block3->params->orderBy = 'id_desc';
|
||||
$block3->dashboard = 'my';
|
||||
|
||||
$block4 = new stdclass();
|
||||
$block4->params = new stdclass();
|
||||
$block4->params->type = 'finishedBy';
|
||||
$block4->params->count = 8;
|
||||
$block4->params->orderBy = 'id_desc';
|
||||
$block4->dashboard = 'my';
|
||||
|
||||
$block5 = new stdclass();
|
||||
$block5->params = new stdclass();
|
||||
$block5->params->type = 'assignedTo';
|
||||
$block5->params->count = 5;
|
||||
$block5->params->orderBy = 'id_asc';
|
||||
$block5->dashboard = 'my';
|
||||
|
||||
$block6 = new stdclass();
|
||||
$block6->params = new stdclass();
|
||||
$block6->params->type = 'assignedTo';
|
||||
$block6->params->count = 100;
|
||||
$block6->params->orderBy = 'id_desc';
|
||||
$block6->dashboard = 'my';
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printTaskBlockTest($block1)) && p('type,count') && e('assignedTo,10'); // 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
r($blockTest->printTaskBlockTest($block2)) && p('type') && e('invalid-type'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printTaskBlockTest($block3)) && p('count') && e('0'); // 步骤3:测试count为0时的处理
|
||||
r($blockTest->printTaskBlockTest($block4)) && p('type,count') && e('finishedBy,8'); // 步骤4:测试不同的type类型参数finishedBy
|
||||
r($blockTest->printTaskBlockTest($block5)) && p('orderBy,type') && e('id_asc,assignedTo'); // 步骤5:测试orderBy参数的传递
|
||||
r(count($blockTest->printTaskBlockTest($block6)->tasks)) && p() && e('5'); // 步骤6:测试较大的count值
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printTesttaskBlock();
|
||||
timeout=0
|
||||
cid=15307
|
||||
|
||||
- 步骤1:测试正常情况下传入type参数为wait和count参数为10
|
||||
- 属性type @wait
|
||||
- 属性count @10
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性type @invalid-type
|
||||
- 步骤3:测试type参数为all时查询所有测试单属性type @all
|
||||
- 步骤4:测试type参数为doing时查询进行中的测试单
|
||||
- 属性type @doing
|
||||
- 属性count @5
|
||||
- 步骤5:测试type参数为done时查询已完成的测试单属性type @done
|
||||
- 步骤6:测试count为0时的处理属性count @0
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
// 4. 准备测试数据
|
||||
$block1 = new stdclass();
|
||||
$block1->params = new stdclass();
|
||||
$block1->params->type = 'wait';
|
||||
$block1->params->count = 10;
|
||||
|
||||
$block2 = new stdclass();
|
||||
$block2->params = new stdclass();
|
||||
$block2->params->type = 'invalid-type';
|
||||
$block2->params->count = 10;
|
||||
|
||||
$block3 = new stdclass();
|
||||
$block3->params = new stdclass();
|
||||
$block3->params->type = 'all';
|
||||
$block3->params->count = 10;
|
||||
|
||||
$block4 = new stdclass();
|
||||
$block4->params = new stdclass();
|
||||
$block4->params->type = 'doing';
|
||||
$block4->params->count = 5;
|
||||
|
||||
$block5 = new stdclass();
|
||||
$block5->params = new stdclass();
|
||||
$block5->params->type = 'done';
|
||||
$block5->params->count = 10;
|
||||
|
||||
$block6 = new stdclass();
|
||||
$block6->params = new stdclass();
|
||||
$block6->params->type = 'wait';
|
||||
$block6->params->count = 0;
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printTesttaskBlockTest($block1)) && p('type,count') && e('wait,10'); // 步骤1:测试正常情况下传入type参数为wait和count参数为10
|
||||
r($blockTest->printTesttaskBlockTest($block2)) && p('type') && e('invalid-type'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printTesttaskBlockTest($block3)) && p('type') && e('all'); // 步骤3:测试type参数为all时查询所有测试单
|
||||
r($blockTest->printTesttaskBlockTest($block4)) && p('type,count') && e('doing,5'); // 步骤4:测试type参数为doing时查询进行中的测试单
|
||||
r($blockTest->printTesttaskBlockTest($block5)) && p('type') && e('done'); // 步骤5:测试type参数为done时查询已完成的测试单
|
||||
r($blockTest->printTesttaskBlockTest($block6)) && p('count') && e('0'); // 步骤6:测试count为0时的处理
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printWaterfallIssueBlock();
|
||||
timeout=0
|
||||
cid=15311
|
||||
|
||||
- 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
- 属性type @active
|
||||
- 属性count @5
|
||||
- 步骤2:测试type参数包含特殊字符时验证失败属性hasValidation @0
|
||||
- 步骤3:测试count为0时的处理属性count @0
|
||||
- 步骤4:测试projectID为0时的处理
|
||||
- 属性type @resolved
|
||||
- 属性projectID @0
|
||||
- 步骤5:测试不同projectID和count参数
|
||||
- 属性type @active
|
||||
- 属性count @8
|
||||
- 步骤6:测试不同的type类型参数
|
||||
- 属性type @closed
|
||||
- 属性count @10
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/block.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$blockTest = new blockTest();
|
||||
|
||||
// 4. 强制要求:必须包含至少5个测试步骤
|
||||
r($blockTest->printWaterfallIssueBlockTest('active', 1, 5, 'id_desc', 'html')) && p('type,count') && e('active,5'); // 步骤1:测试正常情况下传入合法type参数和count参数
|
||||
r($blockTest->printWaterfallIssueBlockTest('invalid-type', 1, 5, 'id_desc', 'html')) && p('hasValidation') && e('0'); // 步骤2:测试type参数包含特殊字符时验证失败
|
||||
r($blockTest->printWaterfallIssueBlockTest('active', 1, 0, 'id_desc', 'html')) && p('count') && e('0'); // 步骤3:测试count为0时的处理
|
||||
r($blockTest->printWaterfallIssueBlockTest('resolved', 0, 5, 'id_desc', 'html')) && p('type,projectID') && e('resolved,0'); // 步骤4:测试projectID为0时的处理
|
||||
r($blockTest->printWaterfallIssueBlockTest('active', 2, 8, 'id_desc', 'html')) && p('type,count') && e('active,8'); // 步骤5:测试不同projectID和count参数
|
||||
r($blockTest->printWaterfallIssueBlockTest('closed', 1, 10, 'id_desc', 'html')) && p('type,count') && e('closed,10'); // 步骤6:测试不同的type类型参数
|
||||
@@ -1,90 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printWaterfallRiskBlock();
|
||||
timeout=0
|
||||
cid=15314
|
||||
|
||||
- 执行blockTest模块的printWaterfallRiskBlockTest方法,参数是$block1
|
||||
- 第count,hasUsers,1条的status属性 @5
|
||||
- 第count,hasUsers,1条的1:project属性 @1
|
||||
- 执行blockTest模块的printWaterfallRiskBlockTest方法,参数是$block2
|
||||
- 第count,hasUsers,1条的status属性 @3
|
||||
- 第count,hasUsers,1条的1:project属性 @1
|
||||
- 执行blockTest模块的printWaterfallRiskBlockTest方法,参数是$block3
|
||||
- 第count,hasUsers,1条的status属性 @2
|
||||
- 第count,hasUsers,1条的1:project属性 @1
|
||||
- 执行blockTest模块的printWaterfallRiskBlockTest方法,参数是$block4
|
||||
- 属性count @5
|
||||
- 属性hasUsers @1
|
||||
- 执行blockTest模块的printWaterfallRiskBlockTest方法,参数是$block5
|
||||
- 属性count @0
|
||||
- 属性hasUsers @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
$project = zenData('project');
|
||||
$project->id->range('1-10');
|
||||
$project->name->range('Project1,Project2,Project3,Project4,Project5,Project6,Project7,Project8,Project9,Project10');
|
||||
$project->type->range('project');
|
||||
$project->model->range('waterfall');
|
||||
$project->status->range('doing');
|
||||
$project->gen(10);
|
||||
|
||||
$risk = zenData('risk');
|
||||
$risk->project->range('1{5},2{3},3{2}');
|
||||
$risk->status->range('active{7},closed{3}');
|
||||
$risk->pri->range('1-4');
|
||||
$risk->gen(10);
|
||||
|
||||
zenData('user')->gen(10);
|
||||
|
||||
su('admin');
|
||||
|
||||
$blockTest = new blockZenTest();
|
||||
|
||||
$block1 = new stdClass();
|
||||
$block1->params = new stdClass();
|
||||
$block1->params->projectID = 1;
|
||||
$block1->params->type = 'active';
|
||||
$block1->params->count = 20;
|
||||
$block1->params->orderBy = 'id_desc';
|
||||
|
||||
$block2 = new stdClass();
|
||||
$block2->params = new stdClass();
|
||||
$block2->params->projectID = 2;
|
||||
$block2->params->type = 'active';
|
||||
$block2->params->count = 20;
|
||||
$block2->params->orderBy = 'id_desc';
|
||||
|
||||
$block3 = new stdClass();
|
||||
$block3->params = new stdClass();
|
||||
$block3->params->projectID = 3;
|
||||
$block3->params->type = 'active';
|
||||
$block3->params->count = 20;
|
||||
$block3->params->orderBy = 'id_desc';
|
||||
|
||||
$block4 = new stdClass();
|
||||
$block4->params = new stdClass();
|
||||
$block4->params->projectID = 1;
|
||||
$block4->params->type = 'all';
|
||||
$block4->params->count = 20;
|
||||
$block4->params->orderBy = 'id_desc';
|
||||
|
||||
$block5 = new stdClass();
|
||||
$block5->params = new stdClass();
|
||||
$block5->params->projectID = 999;
|
||||
$block5->params->type = 'active';
|
||||
$block5->params->count = 20;
|
||||
$block5->params->orderBy = 'id_desc';
|
||||
|
||||
r($blockTest->printWaterfallRiskBlockTest($block1)) && p('count,hasUsers,1:status,1:project') && e('5,1,active,1');
|
||||
r($blockTest->printWaterfallRiskBlockTest($block2)) && p('count,hasUsers,1:status,1:project') && e('3,1,active,2');
|
||||
r($blockTest->printWaterfallRiskBlockTest($block3)) && p('count,hasUsers,1:status,1:project') && e('2,1,active,3');
|
||||
r($blockTest->printWaterfallRiskBlockTest($block4)) && p('count,hasUsers') && e('5,1');
|
||||
r($blockTest->printWaterfallRiskBlockTest($block5)) && p('count,hasUsers') && e('0,1');
|
||||
@@ -628,7 +628,7 @@ class blockZen extends block
|
||||
$this->view->projects = $this->loadModel('project')->getPairsByProgram();
|
||||
$this->view->testtasks = $this->dao->select("DISTINCT t1.*,t2.name as productName,t2.shadow,t3.name as buildName,t4.name as projectName, CONCAT(t4.name, '/', t3.name) as executionBuild")->from(TABLE_TESTTASK)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
|
||||
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=CAST(t3.id AS CHAR)')
|
||||
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.execution=t4.id')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.execution=t5.project')
|
||||
->where('t1.deleted')->eq('0')
|
||||
@@ -1579,7 +1579,7 @@ class blockZen extends block
|
||||
$this->view->project = $this->loadModel('project')->getByID($this->session->project);
|
||||
$this->view->testtasks = $this->dao->select("DISTINCT t1.*,t2.name as productName,t2.shadow,t3.name as buildName,t4.name as executionName, CONCAT(t4.name, '/', t3.name) as executionBuild")->from(TABLE_TESTTASK)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
|
||||
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=CAST(t3.id AS CHAR)')
|
||||
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.execution=t4.id')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project')
|
||||
->where('t1.deleted')->eq('0')
|
||||
|
||||
@@ -379,7 +379,7 @@ class branchModel extends model
|
||||
foreach($data->branch as $branchID => $branch)
|
||||
{
|
||||
if(!$branch) return print(js::alert($this->lang->branch->nameNotEmpty));
|
||||
if($oldBranches[$branchID] != $branch) $this->dao->update(TABLE_BRANCH)->set('name')->eq($branch)->where('id')->eq($branchID)->exec();
|
||||
if(isset($oldBranches[$branchID]) && $oldBranches[$branchID] != $branch) $this->dao->update(TABLE_BRANCH)->set('name')->eq($branch)->where('id')->eq($branchID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class branchModel extends model
|
||||
foreach($data->newbranch as $i => $branch)
|
||||
{
|
||||
if(empty($branch)) continue;
|
||||
$this->dao->insert(TABLE_BRANCH)->set('name')->eq($branch)->set('product')->eq($productID)->set('`order`')->eq(count($data->branch) + $i + 1)->exec();
|
||||
$this->dao->insert(TABLE_BRANCH)->set('name')->eq($branch)->set('product')->eq($productID)->set('order')->eq(count($data->branch) + $i + 1)->exec();
|
||||
$branches[] = $this->dao->lastInsertId();
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ class branchTest
|
||||
$_POST = array();
|
||||
|
||||
// 设置POST数据以模拟实际提交
|
||||
if(!empty($branchData)) $_POST['branch'] = $branchData;
|
||||
$_POST['branch'] = $branchData; // 确保branch总是存在,即使是空数组
|
||||
$_POST['newbranch'] = $newBranches; // 确保newbranch总是存在
|
||||
|
||||
// 调用被测方法
|
||||
|
||||
@@ -1,35 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/branch.unittest.class.php';
|
||||
|
||||
// zendata数据准备
|
||||
zenData('product')->gen(10);
|
||||
zenData('branch')->gen(20);
|
||||
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 branchModel::manage();
|
||||
timeout=0
|
||||
cid=15334
|
||||
cid=0
|
||||
|
||||
- 执行branchTest模块的manageTest方法,参数是4, array @2
|
||||
- 执行branchTest模块的manageTest方法,参数是1, array @0
|
||||
- 执行branchTest模块的manageTest方法,参数是2, array @1
|
||||
- 执行branchTest模块的manageTest方法,参数是3, array @0
|
||||
- 执行branchTest模块的manageTest方法,参数是5, array @1
|
||||
- 执行branchTest模块的manageTest方法,参数是6, array @error
|
||||
- 测试添加2个新分支 @2
|
||||
- 测试更新现有分支名称不添加新分支 @0
|
||||
- 测试同时更新分支并添加1个新分支 @1
|
||||
- 测试更新现有分支名称不添加新分支 @0
|
||||
- 测试新分支列表包含空值过滤后添加1个 @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/branch.unittest.class.php';
|
||||
|
||||
zenData('product')->gen(10);
|
||||
zenData('branch')->gen(20);
|
||||
su('admin');
|
||||
|
||||
$branchTest = new branchTest();
|
||||
|
||||
r($branchTest->manageTest(4, array(), array('新分支1', '新分支2'))) && p() && e('2');
|
||||
r($branchTest->manageTest(1, array(1 => '更新的分支名'), array())) && p() && e('0');
|
||||
r($branchTest->manageTest(2, array(3 => '分支3更新'), array('混合新分支1'))) && p() && e('1');
|
||||
r($branchTest->manageTest(3, array(5 => '分支5更新'), array())) && p() && e('0');
|
||||
r($branchTest->manageTest(5, array(), array('', '有效新分支'))) && p() && e('1');
|
||||
r($branchTest->manageTest(6, array(11 => ''), array())) && p() && e('error');
|
||||
r($branchTest->manageTest(4, array(), array('新分支1', '新分支2'))) && p() && e('2'); // 测试添加2个新分支
|
||||
r($branchTest->manageTest(1, array(1 => '更新的分支名'), array())) && p() && e('0'); // 测试更新现有分支名称不添加新分支
|
||||
r($branchTest->manageTest(2, array(3 => '分支3更新'), array('混合新分支1'))) && p() && e('1'); // 测试同时更新分支并添加1个新分支
|
||||
r($branchTest->manageTest(3, array(5 => '分支5更新'), array())) && p() && e('0'); // 测试更新现有分支名称不添加新分支
|
||||
r($branchTest->manageTest(5, array(), array('', '有效新分支'))) && p() && e('1'); // 测试新分支列表包含空值过滤后添加1个
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::assignProjectRelatedVars();
|
||||
timeout=0
|
||||
cid=15428
|
||||
|
||||
- 步骤1:空输入
|
||||
- 属性noProductProjects @0
|
||||
- 属性productProjects @0
|
||||
- 属性productExecutions @0
|
||||
- 步骤2:无项目执行的bug
|
||||
- 属性noProductProjects @0
|
||||
- 属性noSprintProjects @0
|
||||
- 步骤3:有项目的bug
|
||||
- 属性noProductProjects @0
|
||||
- 属性noSprintProjects @0
|
||||
- 步骤4:有项目和执行的bug
|
||||
- 属性noProductProjects @0
|
||||
- 属性noSprintProjects @0
|
||||
- 步骤5:多产品bugs
|
||||
- 属性noProductProjects @0
|
||||
- 属性noSprintProjects @0
|
||||
- 步骤6:影子产品
|
||||
- 属性noProductProjects @0
|
||||
- 属性noSprintProjects @0
|
||||
- 步骤7:混合产品
|
||||
- 属性noProductProjects @0
|
||||
- 属性noSprintProjects @0
|
||||
- 步骤8:同产品多bugs属性productProjects @1
|
||||
- 步骤9:验证projectExecutions属性projectExecutions @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
zenData('product')->loadYaml('product', false, 2)->gen(10);
|
||||
zenData('project')->gen(20);
|
||||
zenData('build')->gen(20);
|
||||
zenData('projectproduct')->gen(30);
|
||||
zenData('bug')->gen(20);
|
||||
|
||||
su('admin');
|
||||
|
||||
$bugTest = new bugZenTest();
|
||||
|
||||
$emptyBugs = array();
|
||||
$emptyProducts = array();
|
||||
|
||||
$product1 = (object)array('id' => 1, 'name' => '产品1', 'type' => 'normal', 'shadow' => 0);
|
||||
$product2 = (object)array('id' => 2, 'name' => '产品2', 'type' => 'normal', 'shadow' => 0);
|
||||
$product3 = (object)array('id' => 3, 'name' => '产品3', 'type' => 'normal', 'shadow' => 1);
|
||||
|
||||
$bug1 = (object)array('id' => 1, 'product' => 1, 'branch' => 0, 'project' => 0, 'execution' => 0);
|
||||
$bug2 = (object)array('id' => 2, 'product' => 1, 'branch' => 0, 'project' => 1, 'execution' => 0);
|
||||
$bug3 = (object)array('id' => 3, 'product' => 1, 'branch' => 0, 'project' => 1, 'execution' => 1);
|
||||
$bug4 = (object)array('id' => 4, 'product' => 2, 'branch' => 0, 'project' => 0, 'execution' => 0);
|
||||
$bug5 = (object)array('id' => 5, 'product' => 3, 'branch' => 0, 'project' => 0, 'execution' => 0);
|
||||
|
||||
r($bugTest->assignProjectRelatedVarsTest($emptyBugs, $emptyProducts)) && p('noProductProjects,productProjects,productExecutions') && e('0,0,0'); // 步骤1:空输入
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug1), array(1 => $product1))) && p('noProductProjects,noSprintProjects') && e('0,0'); // 步骤2:无项目执行的bug
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug2), array(1 => $product1))) && p('noProductProjects,noSprintProjects') && e('0,0'); // 步骤3:有项目的bug
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug3), array(1 => $product1))) && p('noProductProjects,noSprintProjects') && e('0,0'); // 步骤4:有项目和执行的bug
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug1, $bug4), array(1 => $product1, 2 => $product2))) && p('noProductProjects,noSprintProjects') && e('0,0'); // 步骤5:多产品bugs
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug5), array(3 => $product3))) && p('noProductProjects,noSprintProjects') && e('0,0'); // 步骤6:影子产品
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug1, $bug5), array(1 => $product1, 3 => $product3))) && p('noProductProjects,noSprintProjects') && e('0,0'); // 步骤7:混合产品
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug1, $bug2), array(1 => $product1))) && p('productProjects') && e('1'); // 步骤8:同产品多bugs
|
||||
r($bugTest->assignProjectRelatedVarsTest(array($bug3), array(1 => $product1))) && p('projectExecutions') && e('0'); // 步骤9:验证projectExecutions
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::assignVarsForEdit();
|
||||
timeout=0
|
||||
cid=15431
|
||||
|
||||
- 步骤1:bug有execution的情况属性execution @1
|
||||
- 步骤2:bug有project但无execution的情况属性execution @0
|
||||
- 步骤3:bug无project和execution的情况属性execution @0
|
||||
- 步骤4:bug产品不在products列表中属性products @5
|
||||
- 步骤5:bug有assignedTo的情况属性assignedToList @11
|
||||
- 步骤6:bug状态为closed的情况属性assignedToList @11
|
||||
- 步骤7:bug有story关联的情况属性stories @0
|
||||
- 步骤8:验证openedBuilds属性openedBuilds @2
|
||||
- 步骤9:验证cases数据属性cases @4
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
zenData('product')->gen(5);
|
||||
zenData('project')->gen(5);
|
||||
zenData('bug')->gen(10);
|
||||
zenData('build')->gen(5);
|
||||
zenData('story')->gen(5);
|
||||
zenData('task')->gen(5);
|
||||
zenData('case')->gen(5);
|
||||
zenData('user')->gen(10);
|
||||
zenData('action')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$bugTest = new bugZenTest();
|
||||
|
||||
$product1 = (object)array('id' => 1, 'name' => '产品1', 'type' => 'normal', 'shadow' => 0, 'status' => 'normal');
|
||||
$product2 = (object)array('id' => 2, 'name' => '产品2', 'type' => 'normal', 'shadow' => 0, 'status' => 'normal');
|
||||
$product3 = (object)array('id' => 3, 'name' => '产品3', 'type' => 'normal', 'shadow' => 1, 'status' => 'normal');
|
||||
|
||||
$bug1 = (object)array('id' => 1, 'product' => 1, 'branch' => 0, 'project' => 1, 'execution' => 1, 'module' => 0, 'story' => 1, 'storyTitle' => '需求1', 'assignedTo' => 'admin', 'resolvedBy' => '', 'closedBy' => '', 'openedBy' => 'admin', 'status' => 'active', 'openedBuild' => '1', 'testtask' => 1);
|
||||
$bug2 = (object)array('id' => 2, 'product' => 1, 'branch' => 0, 'project' => 1, 'execution' => 0, 'module' => 0, 'story' => 0, 'storyTitle' => '', 'assignedTo' => 'user1', 'resolvedBy' => '', 'closedBy' => '', 'openedBy' => 'admin', 'status' => 'active', 'openedBuild' => '', 'testtask' => 0);
|
||||
$bug3 = (object)array('id' => 3, 'product' => 1, 'branch' => 0, 'project' => 0, 'execution' => 0, 'module' => 0, 'story' => 0, 'storyTitle' => '', 'assignedTo' => '', 'resolvedBy' => '', 'closedBy' => '', 'openedBy' => 'admin', 'status' => 'active', 'openedBuild' => '', 'testtask' => 0);
|
||||
$bug4 = (object)array('id' => 4, 'product' => 2, 'branch' => 0, 'project' => 0, 'execution' => 0, 'module' => 0, 'story' => 0, 'storyTitle' => '', 'assignedTo' => '', 'resolvedBy' => '', 'closedBy' => '', 'openedBy' => 'admin', 'status' => 'active', 'openedBuild' => '', 'testtask' => 0);
|
||||
$bug5 = (object)array('id' => 5, 'product' => 1, 'branch' => 0, 'project' => 0, 'execution' => 0, 'module' => 0, 'story' => 0, 'storyTitle' => '', 'assignedTo' => 'testuser', 'resolvedBy' => '', 'closedBy' => '', 'openedBy' => 'admin', 'status' => 'active', 'openedBuild' => '', 'testtask' => 0);
|
||||
$bug6 = (object)array('id' => 6, 'product' => 1, 'branch' => 0, 'project' => 0, 'execution' => 0, 'module' => 0, 'story' => 0, 'storyTitle' => '', 'assignedTo' => 'closed', 'resolvedBy' => '', 'closedBy' => 'admin', 'openedBy' => 'admin', 'status' => 'closed', 'openedBuild' => '', 'testtask' => 0);
|
||||
|
||||
r($bugTest->assignVarsForEditTest($bug1, $product1)) && p('execution') && e('1'); // 步骤1:bug有execution的情况
|
||||
r($bugTest->assignVarsForEditTest($bug2, $product1)) && p('execution') && e('0'); // 步骤2:bug有project但无execution的情况
|
||||
r($bugTest->assignVarsForEditTest($bug3, $product1)) && p('execution') && e('0'); // 步骤3:bug无project和execution的情况
|
||||
r($bugTest->assignVarsForEditTest($bug4, $product2)) && p('products') && e('5'); // 步骤4:bug产品不在products列表中
|
||||
r($bugTest->assignVarsForEditTest($bug5, $product1)) && p('assignedToList') && e('11'); // 步骤5:bug有assignedTo的情况
|
||||
r($bugTest->assignVarsForEditTest($bug6, $product1)) && p('assignedToList') && e('11'); // 步骤6:bug状态为closed的情况
|
||||
r($bugTest->assignVarsForEditTest($bug1, $product1)) && p('stories') && e('0'); // 步骤7:bug有story关联的情况
|
||||
r($bugTest->assignVarsForEditTest($bug1, $product1)) && p('openedBuilds') && e('2'); // 步骤8:验证openedBuilds
|
||||
r($bugTest->assignVarsForEditTest($bug1, $product1)) && p('cases') && e('4'); // 步骤9:验证cases数据
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::buildCreateForm();
|
||||
timeout=0
|
||||
cid=15437
|
||||
|
||||
- 步骤1:正常情况下验证产品成员数量属性productMembers @11
|
||||
- 步骤2:from='global'的情况属性gobackLink @buildcreateform.php?m=bug&f=browse&productID=1
|
||||
- 步骤3:有resultID和stepIdList的情况属性resultFilesCount @0
|
||||
- 步骤4:验证产品和项目数据
|
||||
- 属性productsCount @5
|
||||
- 属性projectsCount @0
|
||||
- 步骤5:验证执行和构建数据
|
||||
- 属性executionsCount @0
|
||||
- 属性buildsCount @2
|
||||
- 步骤6:验证模块和分支数据
|
||||
- 属性moduleOptionMenuCount @4
|
||||
- 属性branchesCount @1
|
||||
- 步骤7:验证计划和用例数据
|
||||
- 属性plansCount @3
|
||||
- 属性casesCount @4
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
zenData('product')->gen(5);
|
||||
zenData('project')->gen(5);
|
||||
zenData('bug')->gen(10);
|
||||
zenData('build')->gen(5);
|
||||
zenData('story')->gen(5);
|
||||
zenData('task')->gen(5);
|
||||
zenData('case')->gen(5);
|
||||
zenData('user')->gen(10);
|
||||
zenData('module')->gen(5);
|
||||
zenData('branch')->gen(3);
|
||||
zenData('productplan')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$bugTest = new bugZenTest();
|
||||
|
||||
$bug1 = (object)array(
|
||||
'id' => 0,
|
||||
'productID' => 1,
|
||||
'product' => 1,
|
||||
'branch' => '0',
|
||||
'project' => 1,
|
||||
'projectID' => 1,
|
||||
'execution' => 1,
|
||||
'executionID' => 1,
|
||||
'module' => 0,
|
||||
'moduleID' => 0,
|
||||
'assignedTo' => 'admin',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active'
|
||||
);
|
||||
|
||||
$bug2 = (object)array(
|
||||
'id' => 0,
|
||||
'productID' => 2,
|
||||
'product' => 2,
|
||||
'branch' => '0',
|
||||
'project' => 2,
|
||||
'projectID' => 2,
|
||||
'execution' => 2,
|
||||
'executionID' => 2,
|
||||
'module' => 0,
|
||||
'moduleID' => 0,
|
||||
'assignedTo' => 'user1',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active'
|
||||
);
|
||||
|
||||
$bug3 = (object)array(
|
||||
'id' => 0,
|
||||
'productID' => 1,
|
||||
'product' => 1,
|
||||
'branch' => '1',
|
||||
'project' => 1,
|
||||
'projectID' => 1,
|
||||
'execution' => 1,
|
||||
'executionID' => 1,
|
||||
'module' => 1,
|
||||
'moduleID' => 1,
|
||||
'assignedTo' => 'admin',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active'
|
||||
);
|
||||
|
||||
$param1 = array('resultID' => 0, 'stepIdList' => '', 'executionID' => 1, 'bugID' => 0);
|
||||
$param2 = array('resultID' => 1, 'stepIdList' => '1_2_3', 'executionID' => 2, 'bugID' => 0);
|
||||
$param3 = array('resultID' => 0, 'stepIdList' => '', 'executionID' => 1, 'bugID' => 0);
|
||||
|
||||
r($bugTest->buildCreateFormTest($bug1, $param1, '')) && p('productMembers') && e('11'); // 步骤1:正常情况下验证产品成员数量
|
||||
r($bugTest->buildCreateFormTest($bug1, $param1, 'global')) && p('gobackLink') && e('buildcreateform.php?m=bug&f=browse&productID=1'); // 步骤2:from='global'的情况
|
||||
r($bugTest->buildCreateFormTest($bug2, $param2, '')) && p('resultFilesCount') && e('0'); // 步骤3:有resultID和stepIdList的情况
|
||||
r($bugTest->buildCreateFormTest($bug1, $param1, '')) && p('productsCount,projectsCount') && e('5,0'); // 步骤4:验证产品和项目数据
|
||||
r($bugTest->buildCreateFormTest($bug1, $param1, '')) && p('executionsCount,buildsCount') && e('0,2'); // 步骤5:验证执行和构建数据
|
||||
r($bugTest->buildCreateFormTest($bug3, $param3, '')) && p('moduleOptionMenuCount,branchesCount') && e('4,1'); // 步骤6:验证模块和分支数据
|
||||
r($bugTest->buildCreateFormTest($bug1, $param1, '')) && p('plansCount,casesCount') && e('3,4'); // 步骤7:验证计划和用例数据
|
||||
@@ -1,161 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::buildEditForm();
|
||||
timeout=0
|
||||
cid=15438
|
||||
|
||||
- 步骤1:正常情况下编辑bug,验证基本视图属性
|
||||
- 属性bug @1
|
||||
- 属性product @1
|
||||
- 属性moduleOptionMenu @5
|
||||
- 步骤2:编辑有项目和执行的bug,验证项目和执行数据
|
||||
- 属性projects @1
|
||||
- 属性executions @1
|
||||
- 步骤3:编辑有分支的产品bug,验证分支选项属性branchTagOption @0
|
||||
- 步骤4:编辑有重复bug的情况,验证duplicateBugs数量属性duplicateBugs @0
|
||||
- 步骤5:验证编辑表单的projectID属性projectID @1
|
||||
- 步骤6:无项目的bug,验证项目数据为空
|
||||
- 属性projectID @0
|
||||
- 属性projects @0
|
||||
- 步骤7:有项目无执行的bug,验证执行数据为空
|
||||
- 属性projectID @1
|
||||
- 属性executions @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
zenData('product')->gen(5);
|
||||
zenData('project')->gen(5);
|
||||
zenData('bug')->gen(15);
|
||||
zenData('build')->gen(5);
|
||||
zenData('story')->gen(5);
|
||||
zenData('task')->gen(5);
|
||||
zenData('case')->gen(5);
|
||||
zenData('user')->gen(10);
|
||||
zenData('module')->gen(5);
|
||||
zenData('branch')->gen(3);
|
||||
zenData('productplan')->gen(5);
|
||||
zenData('testtask')->gen(3);
|
||||
zenData('action')->gen(10);
|
||||
|
||||
su('admin');
|
||||
|
||||
$bugTest = new bugZenTest();
|
||||
|
||||
$bug1 = (object)array(
|
||||
'id' => 1,
|
||||
'product' => 1,
|
||||
'branch' => 0,
|
||||
'project' => 1,
|
||||
'execution' => 1,
|
||||
'module' => 1,
|
||||
'title' => 'Test Bug 1',
|
||||
'type' => 'codeerror',
|
||||
'story' => 1,
|
||||
'storyTitle' => 'Story 1',
|
||||
'plan' => 1,
|
||||
'openedBuild' => '1,2',
|
||||
'assignedTo' => 'admin',
|
||||
'resolvedBy' => '',
|
||||
'closedBy' => '',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active',
|
||||
'testtask' => 1
|
||||
);
|
||||
|
||||
$bug2 = (object)array(
|
||||
'id' => 2,
|
||||
'product' => 2,
|
||||
'branch' => 0,
|
||||
'project' => 2,
|
||||
'execution' => 2,
|
||||
'module' => 2,
|
||||
'title' => 'Test Bug 2',
|
||||
'type' => 'codeerror',
|
||||
'story' => 2,
|
||||
'storyTitle' => 'Story 2',
|
||||
'plan' => 2,
|
||||
'openedBuild' => '3',
|
||||
'assignedTo' => 'user1',
|
||||
'resolvedBy' => '',
|
||||
'closedBy' => '',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active',
|
||||
'testtask' => 2
|
||||
);
|
||||
|
||||
$bug3 = (object)array(
|
||||
'id' => 3,
|
||||
'product' => 1,
|
||||
'branch' => 1,
|
||||
'project' => 1,
|
||||
'execution' => 1,
|
||||
'module' => 1,
|
||||
'title' => 'Test Bug 3 with Branch',
|
||||
'type' => 'codeerror',
|
||||
'story' => 1,
|
||||
'storyTitle' => 'Story 1',
|
||||
'plan' => 1,
|
||||
'openedBuild' => '1',
|
||||
'assignedTo' => 'admin',
|
||||
'resolvedBy' => '',
|
||||
'closedBy' => '',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active',
|
||||
'testtask' => 1
|
||||
);
|
||||
|
||||
$bug4 = (object)array(
|
||||
'id' => 4,
|
||||
'product' => 1,
|
||||
'branch' => 0,
|
||||
'project' => 0,
|
||||
'execution' => 0,
|
||||
'module' => 1,
|
||||
'title' => 'Test Bug 4 No Project',
|
||||
'type' => 'codeerror',
|
||||
'story' => 1,
|
||||
'storyTitle' => 'Story 1',
|
||||
'plan' => 1,
|
||||
'openedBuild' => '1',
|
||||
'assignedTo' => 'admin',
|
||||
'resolvedBy' => '',
|
||||
'closedBy' => '',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active',
|
||||
'testtask' => 1
|
||||
);
|
||||
|
||||
$bug5 = (object)array(
|
||||
'id' => 5,
|
||||
'product' => 1,
|
||||
'branch' => 0,
|
||||
'project' => 1,
|
||||
'execution' => 0,
|
||||
'module' => 1,
|
||||
'title' => 'Test Bug 5 with Project Only',
|
||||
'type' => 'codeerror',
|
||||
'story' => 1,
|
||||
'storyTitle' => 'Story 1',
|
||||
'plan' => 1,
|
||||
'openedBuild' => '1',
|
||||
'assignedTo' => 'admin',
|
||||
'resolvedBy' => '',
|
||||
'closedBy' => '',
|
||||
'openedBy' => 'admin',
|
||||
'status' => 'active',
|
||||
'testtask' => 1
|
||||
);
|
||||
|
||||
r($bugTest->buildEditFormTest($bug1)) && p('bug,product,moduleOptionMenu') && e('1,1,5'); // 步骤1:正常情况下编辑bug,验证基本视图属性
|
||||
r($bugTest->buildEditFormTest($bug2)) && p('projects,executions') && e('1,1'); // 步骤2:编辑有项目和执行的bug,验证项目和执行数据
|
||||
r($bugTest->buildEditFormTest($bug3)) && p('branchTagOption') && e('0'); // 步骤3:编辑有分支的产品bug,验证分支选项
|
||||
r($bugTest->buildEditFormTest($bug1)) && p('duplicateBugs') && e('0'); // 步骤4:编辑有重复bug的情况,验证duplicateBugs数量
|
||||
r($bugTest->buildEditFormTest($bug1)) && p('projectID') && e('1'); // 步骤5:验证编辑表单的projectID
|
||||
r($bugTest->buildEditFormTest($bug4)) && p('projectID,projects') && e('0,0'); // 步骤6:无项目的bug,验证项目数据为空
|
||||
r($bugTest->buildEditFormTest($bug5)) && p('projectID,executions') && e('1,0'); // 步骤7:有项目无执行的bug,验证执行数据为空
|
||||
@@ -1,74 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::getAssignedToPairs();
|
||||
timeout=0
|
||||
cid=15446
|
||||
|
||||
- 执行bugTest模块的getAssignedToPairsTest方法,参数是$bug1 @3
|
||||
- 执行bugTest模块的getAssignedToPairsTest方法,参数是$bug2 @2
|
||||
- 执行bugTest模块的getAssignedToPairsTest方法,参数是$bug3 @4
|
||||
- 执行bugTest模块的getAssignedToPairsTest方法,参数是$bug4 @10
|
||||
- 执行$users['closed']) ? 1 : 0 @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
// 准备user测试数据
|
||||
$user = zendata('user');
|
||||
$user->id->range('1-10');
|
||||
$user->account->range('user1,user2,user3,user4,user5,user6,user7,user8,user9,user10');
|
||||
$user->realname->range('用户1,用户2,用户3,用户4,用户5,用户6,用户7,用户8,用户9,用户10');
|
||||
$user->deleted->range('0');
|
||||
$user->gen(10);
|
||||
|
||||
// 准备team测试数据
|
||||
$team = zendata('team');
|
||||
$team->id->range('1-12');
|
||||
$team->root->range('1,1,1,2,2,2,1,1,2,2,3,3');
|
||||
$team->type->range('execution,execution,execution,execution,execution,execution,project,project,project,project,project,project');
|
||||
$team->account->range('user1,user2,user3,user4,user5,user6,user1,user2,user3,user4,user7,user8');
|
||||
$team->gen(12);
|
||||
|
||||
// 准备bug测试数据
|
||||
$bug = zendata('bug');
|
||||
$bug->id->range('1-10');
|
||||
$bug->product->range('1,1,1,1,2,2,2,3,3,3');
|
||||
$bug->project->range('0,1,1,0,0,2,0,0,3,0');
|
||||
$bug->execution->range('1,0,2,0,0,0,0,0,0,0');
|
||||
$bug->branch->range('0');
|
||||
$bug->assignedTo->range('user1,user2,user3,user4,user5,user6,user7,user8,user9,closed');
|
||||
$bug->title->range('Bug1,Bug2,Bug3,Bug4,Bug5,Bug6,Bug7,Bug8,Bug9,Bug10');
|
||||
$bug->status->range('active,active,active,active,active,active,active,active,active,closed');
|
||||
$bug->deleted->range('0');
|
||||
$bug->gen(10);
|
||||
|
||||
su('admin');
|
||||
|
||||
global $tester;
|
||||
$bugTest = new bugZenTest();
|
||||
|
||||
// 测试1:bug有execution=1时,返回execution的团队成员(user1,user2,user3)
|
||||
$bug1 = $tester->dao->select('*')->from(TABLE_BUG)->where('id')->eq(1)->fetch();
|
||||
r(count($bugTest->getAssignedToPairsTest($bug1))) && p() && e('3');
|
||||
|
||||
// 测试2:bug有project=1(无execution)时,返回project的团队成员(user1,user2)
|
||||
$bug2 = $tester->dao->select('*')->from(TABLE_BUG)->where('id')->eq(2)->fetch();
|
||||
r(count($bugTest->getAssignedToPairsTest($bug2))) && p() && e('2');
|
||||
|
||||
// 测试3:bug有execution=2时,返回execution的团队成员(user4,user5,user6)+assignedTo(user3)=4
|
||||
$bug3 = $tester->dao->select('*')->from(TABLE_BUG)->where('id')->eq(3)->fetch();
|
||||
r(count($bugTest->getAssignedToPairsTest($bug3))) && p() && e('4');
|
||||
|
||||
// 测试4:bug只有product=1(无execution和project)时,返回所有用户
|
||||
$bug4 = $tester->dao->select('*')->from(TABLE_BUG)->where('id')->eq(4)->fetch();
|
||||
r(count($bugTest->getAssignedToPairsTest($bug4))) && p() && e('10');
|
||||
|
||||
// 测试5:bug的assignedTo=closed时,不追加到列表
|
||||
$bug10 = $tester->dao->select('*')->from(TABLE_BUG)->where('id')->eq(10)->fetch();
|
||||
$users = $bugTest->getAssignedToPairsTest($bug10);
|
||||
r(isset($users['closed']) ? 1 : 0) && p() && e('0');
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::getBranchOptions();
|
||||
timeout=0
|
||||
cid=15449
|
||||
|
||||
- 执行$result @array
|
||||
- 执行$result @6
|
||||
- 执行$result @4
|
||||
- 执行$result @0
|
||||
- 执行$result @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
global $tester, $app;
|
||||
$app->rawModule = 'bug';
|
||||
$app->rawMethod = 'browse';
|
||||
|
||||
// zendata数据准备
|
||||
$table = zenData('branch');
|
||||
$table->id->range('1-10');
|
||||
$table->product->range('1{5}, 2{3}, 3{2}');
|
||||
$table->name->range('master{2}, develop{2}, feature-v1.0{2}, feature-v2.0{2}, hotfix-bug{2}');
|
||||
$table->status->range('active{8}, closed{2}');
|
||||
$table->deleted->range('0{10}');
|
||||
$table->gen(10);
|
||||
|
||||
$zen = initReference('bug');
|
||||
$func = $zen->getMethod('getBranchOptions');
|
||||
|
||||
// 测试步骤1:正常产品ID获取分支选项
|
||||
$result = $func->invokeArgs($zen->newInstance(), [1]);
|
||||
r(gettype($result)) && p() && e('array');
|
||||
|
||||
// 测试步骤2:获取产品1的分支选项并检查数量
|
||||
$result = $func->invokeArgs($zen->newInstance(), [1]);
|
||||
r(count($result)) && p() && e('6');
|
||||
|
||||
// 测试步骤3:获取产品2的分支选项并检查数量
|
||||
$result = $func->invokeArgs($zen->newInstance(), [2]);
|
||||
r(count($result)) && p() && e('4');
|
||||
|
||||
// 测试步骤4:获取不存在产品的分支选项
|
||||
$result = $func->invokeArgs($zen->newInstance(), [999]);
|
||||
r(count($result)) && p() && e('0');
|
||||
|
||||
// 测试步骤5:测试无效产品ID参数
|
||||
$result = $func->invokeArgs($zen->newInstance(), [0]);
|
||||
r(count($result)) && p() && e('0');
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::getProductsForCreate();
|
||||
timeout=0
|
||||
cid=15457
|
||||
|
||||
- 步骤1:测试在默认tab下获取产品列表,传入productID=1 @1
|
||||
- 步骤2:测试在默认tab下获取产品列表,传入不存在的productID=999 @10
|
||||
- 步骤3:测试返回对象包含products属性 @1
|
||||
- 步骤4:测试返回对象包含productID属性 @1
|
||||
- 步骤5:测试在默认tab下传入空productID @10
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
su('admin');
|
||||
|
||||
$product = zenData('product');
|
||||
$product->id->range('1-10');
|
||||
$product->name->range('产品1,产品2,产品3,产品4,产品5,产品6,产品7,产品8,产品9,产品10');
|
||||
$product->code->range('product1,product2,product3,product4,product5,product6,product7,product8,product9,product10');
|
||||
$product->type->range('normal');
|
||||
$product->status->range('normal');
|
||||
$product->deleted->range('0');
|
||||
$product->gen(10);
|
||||
|
||||
zenData('project')->gen(5);
|
||||
zenData('user')->gen(5);
|
||||
|
||||
$bugTest = new bugZenTest();
|
||||
|
||||
$bug1 = new stdClass();
|
||||
$bug1->productID = 1;
|
||||
$bug1->projectID = 0;
|
||||
$bug1->executionID = 0;
|
||||
|
||||
$bug2 = new stdClass();
|
||||
$bug2->productID = 999;
|
||||
$bug2->projectID = 0;
|
||||
$bug2->executionID = 0;
|
||||
|
||||
$bug3 = new stdClass();
|
||||
$bug3->productID = 1;
|
||||
$bug3->projectID = 0;
|
||||
$bug3->executionID = 0;
|
||||
|
||||
$bug4 = new stdClass();
|
||||
$bug4->productID = 1;
|
||||
$bug4->projectID = 0;
|
||||
$bug4->executionID = 0;
|
||||
|
||||
$bug5 = new stdClass();
|
||||
$bug5->productID = 0;
|
||||
$bug5->projectID = 0;
|
||||
$bug5->executionID = 0;
|
||||
|
||||
r($bugTest->getProductsForCreateTest($bug1)->productID) && p() && e('1'); // 步骤1:测试在默认tab下获取产品列表,传入productID=1
|
||||
r($bugTest->getProductsForCreateTest($bug2)->productID) && p() && e('10'); // 步骤2:测试在默认tab下获取产品列表,传入不存在的productID=999
|
||||
r(property_exists($bugTest->getProductsForCreateTest($bug3), 'products')) && p() && e('1'); // 步骤3:测试返回对象包含products属性
|
||||
r(property_exists($bugTest->getProductsForCreateTest($bug4), 'productID')) && p() && e('1'); // 步骤4:测试返回对象包含productID属性
|
||||
r($bugTest->getProductsForCreateTest($bug5)->productID) && p() && e('10'); // 步骤5:测试在默认tab下传入空productID
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 bugZen::updateTodoAfterCreate();
|
||||
timeout=0
|
||||
cid=15483
|
||||
|
||||
- 测试正常更新待办状态 @1
|
||||
- 测试另一个待办更新 @1
|
||||
- 测试待办类型为feedback的情况 @1
|
||||
- 测试不存在的待办ID @1
|
||||
- 测试第5个待办更新 @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
zenData('todo')->loadYaml('updatetodoaftercreate/todo', false, 2)->gen(10);
|
||||
zenData('action')->gen(0);
|
||||
zenData('bug')->gen(10);
|
||||
zenData('user')->gen(10);
|
||||
zenData('feedback')->gen(0);
|
||||
|
||||
su('admin');
|
||||
|
||||
global $tester;
|
||||
$bugTest = new bugZenTest();
|
||||
|
||||
r($bugTest->updateTodoAfterCreateTest(1, 1)) && p() && e('1'); // 测试正常更新待办状态
|
||||
r($bugTest->updateTodoAfterCreateTest(2, 2)) && p() && e('1'); // 测试另一个待办更新
|
||||
r($bugTest->updateTodoAfterCreateTest(3, 10)) && p() && e('1'); // 测试待办类型为feedback的情况
|
||||
r($bugTest->updateTodoAfterCreateTest(4, 999)) && p() && e('1'); // 测试不存在的待办ID
|
||||
r($bugTest->updateTodoAfterCreateTest(5, 5)) && p() && e('1'); // 测试第5个待办更新
|
||||
@@ -36,6 +36,21 @@ cid=1
|
||||
- 获取产品1下执行下的所有版本信息第1条的name属性 @版本1
|
||||
- 获取产品1下系统内除了版本1-5之外的版本信息 @0
|
||||
|
||||
- 获取系统内所有的版本信息第1条的name属性 @版本1
|
||||
- 获取产品1下的所有版本信息第2条的name属性 @版本2
|
||||
- 获取系统内所有的包括版本信息第3条的name属性 @版本3
|
||||
- 获取所有关联项目版本信息第4条的name属性 @版本4
|
||||
- 获取所有关联执行版本信息第5条的name属性 @版本5
|
||||
- 获取敏捷项目下的所有版本信息第1条的name属性 @版本1
|
||||
- 获取执行下的所有版本信息第1条的name属性 @版本1
|
||||
- 获取系统内除了版本1-5之外的版本信息第6条的name属性 @版本6
|
||||
- 获取产品1下系统内所有的包括版本信息第3条的name属性 @版本3
|
||||
- 获取产品1下所有关联项目版本信息第3条的name属性 @版本3
|
||||
- 获取产品1下所有关联执行版本信息第3条的name属性 @版本3
|
||||
- 获取产品1下敏捷项目下的所有版本信息第1条的name属性 @版本1
|
||||
- 获取产品1下执行下的所有版本信息第1条的name属性 @版本1
|
||||
- 获取产品1下系统内除了版本1-5之外的版本信息 @0
|
||||
|
||||
*/
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/build.unittest.class.php';
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 buildZen::assignCreateData();
|
||||
timeout=0
|
||||
cid=15515
|
||||
|
||||
- 执行buildTest模块的assignCreateDataTest方法,参数是1, 0, 1, '' 属性productID @1
|
||||
- 执行buildTest模块的assignCreateDataTest方法,参数是1, 11, 1, '' 属性executionID @11
|
||||
- 执行buildTest模块的assignCreateDataTest方法,参数是0, 0, 1, '' 第products条的1属性 @产品1
|
||||
- 执行buildTest模块的assignCreateDataTest方法,参数是1, 11, 1, '' 属性executionID @11
|
||||
- 执行buildTest模块的assignCreateDataTest方法,参数是1, 0, 1, 'normal' 属性productID @1
|
||||
- 执行buildTest模块的assignCreateDataTest方法,参数是1, 0, 1, '' 第users条的admin属性 @`A:管理员`
|
||||
- 执行buildTest模块的assignCreateDataTest方法,参数是1, 0, 1, '' 属性productID @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
$product = zenData('product');
|
||||
$product->id->range('1-5');
|
||||
$product->name->range('产品1,产品2,产品3,产品4,产品5');
|
||||
$product->type->range('normal{3},branch{1},platform{1}');
|
||||
$product->status->range('normal{4},closed{1}');
|
||||
$product->gen(5);
|
||||
|
||||
$project = zenData('project');
|
||||
$project->id->range('1-5');
|
||||
$project->name->range('项目1,项目2,项目3,项目4,项目5');
|
||||
$project->type->range('project{3},sprint{2}');
|
||||
$project->status->range('doing{3},wait{1},closed{1}');
|
||||
$project->parent->range('0');
|
||||
$project->path->range('`,1,`,`,2,`,`,3,`,`,4,`,`,5,`');
|
||||
$project->grade->range('1');
|
||||
$project->model->range('scrum{2},waterfall{2},kanban{1}');
|
||||
$project->gen(5);
|
||||
|
||||
$execution = zenData('project');
|
||||
$execution->id->range('11-15');
|
||||
$execution->project->range('1-3');
|
||||
$execution->name->range('迭代1,迭代2,迭代3,迭代4,迭代5');
|
||||
$execution->type->range('sprint{3},stage{2}');
|
||||
$execution->status->range('doing{3},wait{1},closed{1}');
|
||||
$execution->parent->range('1-3');
|
||||
$execution->path->range('`,1,11,`,`,1,12,`,`,2,13,`,`,2,14,`,`,3,15,`');
|
||||
$execution->grade->range('2');
|
||||
$execution->gen(5);
|
||||
|
||||
$projectProduct = zenData('projectproduct');
|
||||
$projectProduct->project->range('1-15');
|
||||
$projectProduct->product->range('1-5');
|
||||
$projectProduct->gen(15);
|
||||
|
||||
$user = zenData('user');
|
||||
$user->id->range('1-10');
|
||||
$user->account->range('admin,user1,user2,user3,user4,user5,user6,user7,user8,user9');
|
||||
$user->realname->range('管理员,用户1,用户2,用户3,用户4,用户5,用户6,用户7,用户8,用户9');
|
||||
$user->deleted->range('0{9},1{1}');
|
||||
$user->gen(10);
|
||||
|
||||
zenData('build')->gen(0);
|
||||
|
||||
global $tester;
|
||||
$tester->app->rawModule = 'build';
|
||||
$tester->app->rawMethod = 'create';
|
||||
$tester->app->tab = 'project';
|
||||
$tester->app->moduleName = 'build';
|
||||
$tester->app->methodName = 'create';
|
||||
$_SESSION['project'] = 1;
|
||||
|
||||
su('admin');
|
||||
|
||||
$buildTest = new buildZenTest();
|
||||
|
||||
r($buildTest->assignCreateDataTest(1, 0, 1, '')) && p('productID') && e('1');
|
||||
r($buildTest->assignCreateDataTest(1, 11, 1, '')) && p('executionID') && e('11');
|
||||
r($buildTest->assignCreateDataTest(0, 0, 1, '')) && p('products:1') && e('产品1');
|
||||
r($buildTest->assignCreateDataTest(1, 11, 1, '')) && p('executionID') && e('11');
|
||||
r($buildTest->assignCreateDataTest(1, 0, 1, 'normal')) && p('productID') && e('1');
|
||||
r($buildTest->assignCreateDataTest(1, 0, 1, '')) && p('users:admin') && e('`A:管理员`');
|
||||
r($buildTest->assignCreateDataTest(1, 0, 1, '')) && p('productID') && e('1');
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 caselibZen::prepareCasesForBathcCreate();
|
||||
timeout=0
|
||||
cid=15552
|
||||
|
||||
- 执行caselibTest模块的prepareCasesForBathcCreateTest方法,参数是1
|
||||
- 第0条的title属性 @Test Case Title 1
|
||||
- 第0条的type属性 @feature
|
||||
- 第0条的lib属性 @1
|
||||
- 第0条的project属性 @0
|
||||
- 第0条的status属性 @normal
|
||||
- 第0条的version属性 @1
|
||||
- 执行caselibTest模块的prepareCasesForBathcCreateTest方法,参数是1, 'empty' @1
|
||||
- 执行caselibTest模块的prepareCasesForBathcCreateTest方法,参数是1, 'empty' @1
|
||||
- 执行caselibTest模块的prepareCasesForBathcCreateTest方法,参数是2, 'count' @3
|
||||
- 执行caselibTest模块的prepareCasesForBathcCreateTest方法,参数是3
|
||||
- 第0条的openedBy属性 @guest
|
||||
- 第0条的version属性 @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/caselib.unittest.class.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
$caselibTest = new caselibTest();
|
||||
|
||||
// 测试步骤1:正常输入情况,包含所有必填字段
|
||||
$_POST['title'] = array(0 => 'Test Case Title 1');
|
||||
$_POST['type'] = array(0 => 'feature');
|
||||
$_POST['pri'] = array(0 => 3);
|
||||
$_POST['module'] = array(0 => 0);
|
||||
$_POST['stage'] = array(0 => 'unittest');
|
||||
r($caselibTest->prepareCasesForBathcCreateTest(1)) && p('0:title,type,lib,project,status,version') && e('Test Case Title 1,feature,1,0,normal,1');
|
||||
|
||||
// 测试步骤2:缺少title字段的情况
|
||||
$_POST['title'] = array(0 => '');
|
||||
$_POST['type'] = array(0 => 'feature');
|
||||
r($caselibTest->prepareCasesForBathcCreateTest(1, 'empty')) && p() && e('1');
|
||||
|
||||
// 测试步骤3:缺少type字段的情况
|
||||
$_POST['title'] = array(0 => 'Test Case Title 2');
|
||||
$_POST['type'] = array(0 => '');
|
||||
r($caselibTest->prepareCasesForBathcCreateTest(1, 'empty')) && p() && e('1');
|
||||
|
||||
// 测试步骤4:批量创建多个用例的情况
|
||||
$_POST['title'] = array(0 => 'Test Case 1', 1 => 'Test Case 2', 2 => 'Test Case 3');
|
||||
$_POST['type'] = array(0 => 'feature', 1 => 'performance', 2 => 'interface');
|
||||
$_POST['pri'] = array(0 => 1, 1 => 2, 2 => 3);
|
||||
r($caselibTest->prepareCasesForBathcCreateTest(2, 'count')) && p() && e('3');
|
||||
|
||||
// 测试步骤5:验证返回用例的字段完整性
|
||||
$_POST['title'] = array(0 => 'Complete Test Case');
|
||||
$_POST['type'] = array(0 => 'feature');
|
||||
$_POST['pri'] = array(0 => 2);
|
||||
$_POST['module'] = array(0 => 5);
|
||||
$_POST['precondition'] = array(0 => 'Test precondition');
|
||||
$_POST['keywords'] = array(0 => 'keyword1,keyword2');
|
||||
$_POST['stage'] = array(0 => 'unittest');
|
||||
r($caselibTest->prepareCasesForBathcCreateTest(3)) && p('0:openedBy,version') && e('guest,1');
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 caselibZen::prepareEditExtras();
|
||||
timeout=0
|
||||
cid=15553
|
||||
|
||||
- 执行caselibTest模块的prepareEditExtrasTest方法,参数是$formData1, 1
|
||||
- 属性id @1
|
||||
- 属性name @Test Case Library
|
||||
- 执行caselibTest模块的prepareEditExtrasTest方法,参数是$formData2, 2
|
||||
- 属性id @2
|
||||
- 属性uid @empty-uid
|
||||
- 执行caselibTest模块的prepareEditExtrasTest方法,参数是$formData3, 3
|
||||
- 属性id @3
|
||||
- 属性name @Another Library
|
||||
- 执行caselibTest模块的prepareEditExtrasTest方法,参数是$formData4, 0 属性lastEditedBy @admin
|
||||
- 执行caselibTest模块的prepareEditExtrasTest方法,参数是$formData5, 5
|
||||
- 属性id @5
|
||||
- 属性uid @file-test-uid
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/caselib.unittest.class.php';
|
||||
|
||||
zenData('testsuite')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$caselibTest = new caselibTest();
|
||||
|
||||
// 创建测试数据数组
|
||||
$formData1 = array('name' => 'Test Case Library', 'desc' => 'Test Description', 'uid' => 'test-uid-123');
|
||||
$formData2 = array('name' => '', 'desc' => '', 'uid' => 'empty-uid');
|
||||
$formData3 = array('name' => 'Another Library', 'desc' => '', 'uid' => 'another-uid');
|
||||
$formData4 = array('name' => 'Time Test Library', 'desc' => '', 'uid' => 'time-test-uid');
|
||||
$formData5 = array('name' => 'File Test Library', 'desc' => '<img src="test.jpg">', 'uid' => 'file-test-uid');
|
||||
|
||||
r($caselibTest->prepareEditExtrasTest($formData1, 1)) && p('id,name') && e('1,Test Case Library');
|
||||
r($caselibTest->prepareEditExtrasTest($formData2, 2)) && p('id,uid') && e('2,empty-uid');
|
||||
r($caselibTest->prepareEditExtrasTest($formData3, 3)) && p('id,name') && e('3,Another Library');
|
||||
r($caselibTest->prepareEditExtrasTest($formData4, 0)) && p('lastEditedBy') && e('admin');
|
||||
r($caselibTest->prepareEditExtrasTest($formData5, 5)) && p('id,uid') && e('5,file-test-uid');
|
||||
@@ -1,73 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 caselibZen::processCasesForExport();
|
||||
timeout=0
|
||||
cid=15554
|
||||
|
||||
- 步骤1:测试空用例数组处理 @0
|
||||
- 步骤2:测试单个用例的基本字段处理 @1
|
||||
- 步骤3:测试用例类型字段被转换 @功能测试
|
||||
- 步骤4:测试用例返回数量 @1
|
||||
- 步骤5:测试用例日期字段格式化 @0
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/caselib.unittest.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$caseTable = zenData('case');
|
||||
$caseTable->id->range('1-10');
|
||||
$caseTable->lib->range('1{5},2{5}');
|
||||
$caseTable->title->range('用例标题1,用例标题2,用例标题3,用例标题4,用例标题5,用例标题6,用例标题7,用例标题8,用例标题9,用例标题10');
|
||||
$caseTable->module->range('101,102,103,104,105,106,107,108,109,110');
|
||||
$caseTable->pri->range('1,2,3,4,1,2,3,4,1,2');
|
||||
$caseTable->type->range('feature,performance,config,install,security,interface,feature,performance,config,install');
|
||||
$caseTable->status->range('normal,blocked,investigate,normal,normal,blocked,normal,normal,investigate,normal');
|
||||
$caseTable->stage->range('unittest,feature,integration,system,smoke,unittest,feature,integration,system,smoke');
|
||||
$caseTable->openedBy->range('admin,user1,user2,user3,admin,user1,user2,user3,admin,user1');
|
||||
$caseTable->lastEditedBy->range('admin,user1,user2,user3,admin,user1,user2,user3,admin,user1');
|
||||
$caseTable->openedDate->range('`2024-01-01 10:00:00`,`2024-01-02 11:00:00`,`2024-01-03 12:00:00`,`2024-01-04 13:00:00`,`2024-01-05 14:00:00`,`2024-01-06 15:00:00`,`2024-01-07 16:00:00`,`2024-01-08 17:00:00`,`2024-01-09 18:00:00`,`0000-00-00 00:00:00`');
|
||||
$caseTable->lastRunDate->range('`2024-02-01 10:00:00`,`2024-02-02 11:00:00`,`2024-02-03 12:00:00`,`2024-02-04 13:00:00`,`2024-02-05 14:00:00`,`2024-02-06 15:00:00`,`2024-02-07 16:00:00`,`2024-02-08 17:00:00`,`2024-02-09 18:00:00`,`0000-00-00 00:00:00`');
|
||||
$caseTable->linkCase->range('0,2,0,4,0,6,0,8,0,0');
|
||||
$caseTable->gen(10);
|
||||
|
||||
$moduleTable = zenData('module');
|
||||
$moduleTable->id->range('101-120');
|
||||
$moduleTable->name->range('模块1,模块2,模块3,模块4,模块5,模块6,模块7,模块8,模块9,模块10,模块11,模块12,模块13,模块14,模块15,模块16,模块17,模块18,模块19,模块20');
|
||||
$moduleTable->type->range('caselib{20}');
|
||||
$moduleTable->root->range('1{10},2{10}');
|
||||
$moduleTable->gen(20);
|
||||
|
||||
$userTable = zenData('user');
|
||||
$userTable->id->range('1-10');
|
||||
$userTable->account->range('admin,user1,user2,user3,user4,user5,user6,user7,user8,user9');
|
||||
$userTable->realname->range('管理员,用户1,用户2,用户3,用户4,用户5,用户6,用户7,用户8,用户9');
|
||||
$userTable->gen(10);
|
||||
|
||||
$stepTable = zenData('casestep');
|
||||
$stepTable->id->range('1-15');
|
||||
$stepTable->case->range('1{3},2{3},3{3},4{3},5{3}');
|
||||
$stepTable->version->range('1{15}');
|
||||
$stepTable->type->range('step{15}');
|
||||
$stepTable->parent->range('0{15}');
|
||||
$stepTable->desc->range('步骤1,步骤2,步骤3,步骤A,步骤B,步骤C,测试步骤1,测试步骤2,测试步骤3,操作1,操作2,操作3,执行1,执行2,执行3');
|
||||
$stepTable->expect->range('预期1,预期2,预期3,预期A,预期B,预期C,测试预期1,测试预期2,测试预期3,结果1,结果2,结果3,期望1,期望2,期望3');
|
||||
$stepTable->gen(15);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$caselibTest = new caselibTest();
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($caselibTest->processCasesForExportTest(array(), 1, array('fileType' => 'csv'), 'count')) && p() && e('0'); // 步骤1:测试空用例数组处理
|
||||
r($caselibTest->processCasesForExportTest(array(1 => (object)array('id' => 1, 'title' => '测试用例', 'pri' => 1, 'type' => 'feature', 'status' => 'normal', 'stage' => 'unittest', 'openedBy' => 'admin', 'lastEditedBy' => 'admin', 'module' => 101, 'openedDate' => '2024-01-01 10:00:00', 'lastRunDate' => '2024-02-01 10:00:00', 'linkCase' => '')), 1, array('fileType' => 'csv'), 'first_case_pri')) && p() && e('1'); // 步骤2:测试单个用例的基本字段处理
|
||||
r($caselibTest->processCasesForExportTest(array(1 => (object)array('id' => 1, 'title' => '测试用例', 'pri' => 1, 'type' => 'feature', 'status' => 'normal', 'stage' => 'unittest', 'openedBy' => 'admin', 'lastEditedBy' => 'admin', 'module' => 101, 'openedDate' => '2024-01-01 10:00:00', 'lastRunDate' => '2024-02-01 10:00:00', 'linkCase' => '')), 1, array('fileType' => 'csv'), 'first_case_type')) && p() && e('功能测试'); // 步骤3:测试用例类型字段被转换
|
||||
r($caselibTest->processCasesForExportTest(array(1 => (object)array('id' => 1, 'title' => '测试用例', 'pri' => 1, 'type' => 'feature', 'status' => 'normal', 'stage' => 'unittest', 'openedBy' => 'admin', 'lastEditedBy' => 'admin', 'module' => 101, 'openedDate' => '2024-01-01 10:00:00', 'lastRunDate' => '2024-02-01 10:00:00', 'linkCase' => '')), 1, array('fileType' => 'csv'), 'count')) && p() && e('1'); // 步骤4:测试用例返回数量
|
||||
r($caselibTest->processCasesForExportTest(array(10 => (object)array('id' => 10, 'title' => '测试用例10', 'pri' => 2, 'type' => 'install', 'status' => 'normal', 'stage' => 'smoke', 'openedBy' => 'user1', 'lastEditedBy' => 'user1', 'module' => 110, 'openedDate' => '0000-00-00 00:00:00', 'lastRunDate' => '0000-00-00 00:00:00', 'linkCase' => '')), 2, array('fileType' => 'csv'), 'first_case_openedDate')) && p() && e('0'); // 步骤5:测试用例日期字段格式化
|
||||
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
|
||||
require_once dirname(__FILE__, 5) . '/test/lib/test.class.php';
|
||||
|
||||
class cneModelTest extends baseTest
|
||||
{
|
||||
protected $moduleName = 'cne';
|
||||
protected $className = 'model';
|
||||
|
||||
/**
|
||||
* Test apiGet method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param array|object $data
|
||||
* @param array $header
|
||||
* @param string $host
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function apiGetTest(string $url, array|object $data, array $header = array(), string $host = '')
|
||||
{
|
||||
$result = $this->invokeArgs('apiGet', [$url, $data, $header, $host]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test apiPost method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param array|object $data
|
||||
* @param array $header
|
||||
* @param string $host
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function apiPostTest(string $url, array|object $data, array $header = array(), string $host = '')
|
||||
{
|
||||
$result = $this->invokeArgs('apiPost', [$url, $data, $header, $host]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test backup method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @param string|null $account
|
||||
* @param string $mode
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function backupTest(object $instance, string|null $account = '', string $mode = '')
|
||||
{
|
||||
$result = $this->invokeArgs('backup', [$instance, $account, $mode]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test cneServerError method.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function cneServerErrorTest()
|
||||
{
|
||||
$result = $this->invokeArgs('cneServerError', []);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test deleteBackup method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @param string $backupName
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function deleteBackupTest(object $instance, string $backupName)
|
||||
{
|
||||
$result = $this->invokeArgs('deleteBackup', [$instance, $backupName]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getAppVolumes method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @param bool|string $component
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAppVolumesTest(object $instance, bool|string $component = false)
|
||||
{
|
||||
$result = $this->invokeArgs('getAppVolumes', [$instance, $component]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getBackupList method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function getBackupListTest(object $instance)
|
||||
{
|
||||
$result = $this->invokeArgs('getBackupList', [$instance]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getBackupStatus method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @param string $backupName
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function getBackupStatusTest(object $instance, string $backupName)
|
||||
{
|
||||
$result = $this->invokeArgs('getBackupStatus', [$instance, $backupName]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getDiskSettings method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @param bool|string $component
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDiskSettingsTest(object $instance, bool|string $component = false)
|
||||
{
|
||||
$result = $this->invokeArgs('getDiskSettings', [$instance, $component]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getVolumesMetrics method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function getVolumesMetricsTest(object $instance)
|
||||
{
|
||||
$result = $this->invokeArgs('getVolumesMetrics', [$instance]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test installApp method.
|
||||
*
|
||||
* @param object $apiParams
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function installAppTest(object $apiParams)
|
||||
{
|
||||
$result = $this->invokeArgs('installApp', [$apiParams]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test restore method.
|
||||
*
|
||||
* @param object $instance
|
||||
* @param string $backupName
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function restoreTest(object $instance, string $backupName, string $account = '')
|
||||
{
|
||||
$result = $this->invokeArgs('restore', [$instance, $backupName, $account]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test translateError method.
|
||||
*
|
||||
* @param object $apiResult
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function translateErrorTest(object &$apiResult)
|
||||
{
|
||||
$cne = $this->getInstance('cne', 'model');
|
||||
$reflection = new ReflectionClass($cne);
|
||||
$method = $reflection->getMethod('translateError');
|
||||
$method->setAccessible(true);
|
||||
$result = $method->invokeArgs($cne, array(&$apiResult));
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -5,23 +5,25 @@
|
||||
|
||||
title=测试 cneModel::apiGet();
|
||||
timeout=0
|
||||
cid=15599
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常的API GET请求属性code @200
|
||||
- 测试步骤2:带查询参数的API GET请求第data条的name属性 @my-app
|
||||
- 测试步骤3:API返回404错误的情况属性code @404
|
||||
- 测试步骤4:API返回401认证错误的情况属性code @401
|
||||
- 测试步骤5:使用自定义host的API GET请求属性code @200
|
||||
- 测试正常GET请求:有效的URL和参数属性code @600
|
||||
- 测试空数据参数:验证空数组处理属性code @600
|
||||
- 测试带已有查询参数的URL属性code @600
|
||||
- 测试自定义header参数属性code @600
|
||||
- 测试自定义host参数属性code @600
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->apiGetTest('/api/cne/app/status', array('name' => 'test-app'), array(), '')) && p('code') && e('200'); // 测试步骤1:正常的API GET请求
|
||||
r($cneTest->apiGetTest('/api/cne/app/info', array('name' => 'my-app'), array(), '')) && p('data:name') && e('my-app'); // 测试步骤2:带查询参数的API GET请求
|
||||
r($cneTest->apiGetTest('/api/cne/app/error', array(), array(), '')) && p('code') && e('404'); // 测试步骤3:API返回404错误的情况
|
||||
r($cneTest->apiGetTest('/api/cne/app/auth-error', array(), array(), '')) && p('code') && e('401'); // 测试步骤4:API返回401认证错误的情况
|
||||
r($cneTest->apiGetTest('/api/cne/app/custom-host', array(), array(), 'http://custom-host')) && p('code') && e('200'); // 测试步骤5:使用自定义host的API GET请求
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
r($cneTest->apiGetTest('/api/cne/test', array('param1' => 'value1'), array(), '')) && p('code') && e('600'); // 测试正常GET请求:有效的URL和参数
|
||||
r($cneTest->apiGetTest('/api/cne/test', array(), array(), '')) && p('code') && e('600'); // 测试空数据参数:验证空数组处理
|
||||
r($cneTest->apiGetTest('/api/cne/test?existing=param', array('new' => 'param'), array(), '')) && p('code') && e('600'); // 测试带已有查询参数的URL
|
||||
r($cneTest->apiGetTest('/api/cne/test', array('param' => 'value'), array('Authorization: Bearer token'), '')) && p('code') && e('600'); // 测试自定义header参数
|
||||
r($cneTest->apiGetTest('/api/cne/test', array('param' => 'value'), array(), 'http://custom-host.com')) && p('code') && e('600'); // 测试自定义host参数
|
||||
@@ -5,23 +5,25 @@
|
||||
|
||||
title=测试 cneModel::apiPost();
|
||||
timeout=0
|
||||
cid=15600
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常的API POST请求属性code @200
|
||||
- 测试步骤2:使用对象数据的POST请求第data条的name属性 @new-app
|
||||
- 测试步骤3:API返回400错误的情况属性code @400
|
||||
- 测试步骤4:网络错误的情况属性code @600
|
||||
- 测试步骤5:使用自定义host的POST请求属性code @200
|
||||
- 执行cneTest模块的apiPostTest方法,参数是'/api/test', array @1
|
||||
- 执行cneTest模块的apiPostTest方法,参数是'', array @1
|
||||
- 执行cneTest模块的apiPostTest方法,参数是'/api/test', array @1
|
||||
- 执行cneTest模块的apiPostTest方法,参数是'/api/test', @1
|
||||
- 执行cneTest模块的apiPostTest方法,参数是'/api/test', array @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->apiPostTest('/api/cne/app/install', array('name' => 'test-app'), array(), '')) && p('code') && e('200'); // 测试步骤1:正常的API POST请求
|
||||
r($cneTest->apiPostTest('/api/cne/app/create', (object)array('name' => 'new-app'), array(), '')) && p('data:name') && e('new-app'); // 测试步骤2:使用对象数据的POST请求
|
||||
r($cneTest->apiPostTest('/api/cne/app/error', array(), array(), '')) && p('code') && e('400'); // 测试步骤3:API返回400错误的情况
|
||||
r($cneTest->apiPostTest('/api/cne/app/network-error', array(), array(), '')) && p('code') && e('600'); // 测试步骤4:网络错误的情况
|
||||
r($cneTest->apiPostTest('/api/cne/app/custom-host', array(), array(), 'http://custom-host')) && p('code') && e('200'); // 测试步骤5:使用自定义host的POST请求
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
r(is_object($cneTest->apiPostTest('/api/test', array('key' => 'value')))) && p() && e('1');
|
||||
r(is_object($cneTest->apiPostTest('', array()))) && p() && e('1');
|
||||
r(is_object($cneTest->apiPostTest('/api/test', array()))) && p() && e('1');
|
||||
r(is_object($cneTest->apiPostTest('/api/test', (object)array('key' => 'value')))) && p() && e('1');
|
||||
r(is_object($cneTest->apiPostTest('/api/test', array('key' => 'value'), array('Content-Type: application/json')))) && p() && e('1');
|
||||
@@ -5,23 +5,44 @@
|
||||
|
||||
title=测试 cneModel::backup();
|
||||
timeout=0
|
||||
cid=15603
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常备份请求,实例ID=1,默认账号属性code @200
|
||||
- 测试步骤2:备份请求,实例ID=2,指定账号testuser第data条的account属性 @testuser
|
||||
- 测试步骤3:备份请求,实例ID=3,指定mode=manual第data条的mode属性 @manual
|
||||
- 测试步骤4:备份请求,实例ID=4,指定mode=system第data条的mode属性 @system
|
||||
- 测试步骤5:备份请求,实例ID=5,指定mode=upgrade第data条的mode属性 @upgrade
|
||||
- 执行cneTest模块的backupTest方法,参数是$instance1, 'testuser', 'manual' @1
|
||||
- 执行cneTest模块的backupTest方法,参数是$instance2, '', 'system' @1
|
||||
- 执行cneTest模块的backupTest方法,参数是$instance3, 'customuser', 'upgrade' @1
|
||||
- 执行cneTest模块的backupTest方法,参数是$instance1, null, 'downgrade' @1
|
||||
- 执行cneTest模块的backupTest方法,参数是$instance2, 'admin', '' @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->backupTest(1, null, '')) && p('code') && e('200'); // 测试步骤1:正常备份请求,实例ID=1,默认账号
|
||||
r($cneTest->backupTest(2, 'testuser', '')) && p('data:account') && e('testuser'); // 测试步骤2:备份请求,实例ID=2,指定账号testuser
|
||||
r($cneTest->backupTest(3, null, 'manual')) && p('data:mode') && e('manual'); // 测试步骤3:备份请求,实例ID=3,指定mode=manual
|
||||
r($cneTest->backupTest(4, 'admin', 'system')) && p('data:mode') && e('system'); // 测试步骤4:备份请求,实例ID=4,指定mode=system
|
||||
r($cneTest->backupTest(5, 'admin', 'upgrade')) && p('data:mode') && e('upgrade'); // 测试步骤5:备份请求,实例ID=5,指定mode=upgrade
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 构建测试用的instance对象
|
||||
$instance1 = new stdclass();
|
||||
$instance1->spaceData = new stdclass();
|
||||
$instance1->spaceData->k8space = 'test-namespace';
|
||||
$instance1->k8name = 'test-app';
|
||||
$instance1->channel = 'stable';
|
||||
|
||||
$instance2 = new stdclass();
|
||||
$instance2->spaceData = new stdclass();
|
||||
$instance2->spaceData->k8space = 'default';
|
||||
$instance2->k8name = 'app-instance';
|
||||
$instance2->channel = '';
|
||||
|
||||
$instance3 = new stdclass();
|
||||
$instance3->spaceData = new stdclass();
|
||||
$instance3->spaceData->k8space = 'prod-namespace';
|
||||
$instance3->k8name = 'prod-app';
|
||||
$instance3->channel = 'dev';
|
||||
|
||||
r(is_object($cneTest->backupTest($instance1, 'testuser', 'manual'))) && p() && e('1');
|
||||
r(is_object($cneTest->backupTest($instance2, '', 'system'))) && p() && e('1');
|
||||
r(is_object($cneTest->backupTest($instance3, 'customuser', 'upgrade'))) && p() && e('1');
|
||||
r(is_object($cneTest->backupTest($instance1, null, 'downgrade'))) && p() && e('1');
|
||||
r(is_object($cneTest->backupTest($instance2, 'admin', ''))) && p() && e('1');
|
||||
@@ -5,23 +5,27 @@
|
||||
|
||||
title=测试 cneModel::cneServerError();
|
||||
timeout=0
|
||||
cid=15608
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常情况下返回CNE服务器错误对象属性code @600
|
||||
- 测试步骤2:正常情况下返回CNE服务器错误对象属性message @CNE服务器出错
|
||||
- 测试步骤3:验证返回对象的数据类型 @object
|
||||
- 测试步骤4:验证返回对象包含code属性 @1
|
||||
- 测试步骤5:验证返回对象包含message属性 @1
|
||||
- 步骤1:验证返回对象code属性值为600属性code @600
|
||||
- 步骤2:验证返回对象message属性值属性message @CNE服务器出错
|
||||
- 步骤3:验证返回对象同时包含正确的code和message
|
||||
- 属性code @600
|
||||
- 属性message @CNE服务器出错
|
||||
- 步骤4:验证返回对象类型为stdClass @stdClass
|
||||
- 步骤5:验证返回对象同时包含code和message属性 @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->cneServerErrorTest()) && p('code') && e('600'); // 测试步骤1:正常情况下返回CNE服务器错误对象
|
||||
r($cneTest->cneServerErrorTest()) && p('message') && e('CNE服务器出错'); // 测试步骤2:正常情况下返回CNE服务器错误对象
|
||||
r(gettype($cneTest->cneServerErrorTest())) && p() && e('object'); // 测试步骤3:验证返回对象的数据类型
|
||||
r(property_exists($cneTest->cneServerErrorTest(), 'code')) && p() && e('1'); // 测试步骤4:验证返回对象包含code属性
|
||||
r(property_exists($cneTest->cneServerErrorTest(), 'message')) && p() && e('1'); // 测试步骤5:验证返回对象包含message属性
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
r($cneTest->cneServerErrorTest()) && p('code') && e('600'); // 步骤1:验证返回对象code属性值为600
|
||||
r($cneTest->cneServerErrorTest()) && p('message') && e('CNE服务器出错'); // 步骤2:验证返回对象message属性值
|
||||
r($cneTest->cneServerErrorTest()) && p('code,message') && e('600,CNE服务器出错'); // 步骤3:验证返回对象同时包含正确的code和message
|
||||
r(get_class($cneTest->cneServerErrorTest())) && p() && e('stdClass'); // 步骤4:验证返回对象类型为stdClass
|
||||
r(property_exists($cneTest->cneServerErrorTest(), 'code') && property_exists($cneTest->cneServerErrorTest(), 'message')) && p() && e('1'); // 步骤5:验证返回对象同时包含code和message属性
|
||||
@@ -5,27 +5,60 @@
|
||||
|
||||
title=测试 cneModel::deleteBackup();
|
||||
timeout=0
|
||||
cid=15610
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常删除备份,实例ID=1,正常备份名称属性code @200
|
||||
- 测试步骤2:删除备份,实例ID=2,正常备份名称属性code @200
|
||||
- 测试步骤3:删除不存在的备份,实例ID=3,不存在的备份名称属性code @200
|
||||
- 测试步骤4:删除备份,无效实例ID=0属性code @404
|
||||
- 测试步骤5:删除备份,不存在实例ID=999属性code @404
|
||||
- 测试步骤6:删除备份,实例ID=4,空备份名称属性code @400
|
||||
- 测试步骤7:删除备份,实例ID=5,特殊字符备份名称属性code @200
|
||||
- 执行cneTest模块的deleteBackupTest方法,参数是$instance1, 'backup-20240101-120000' @1
|
||||
- 执行cneTest模块的deleteBackupTest方法,参数是$instance2, 'backup-20240102-120000' @1
|
||||
- 执行cneTest模块的deleteBackupTest方法,参数是$instance3, 'backup-20240103-120000' @1
|
||||
- 执行cneTest模块的deleteBackupTest方法,参数是$instance4, 'backup-20240104-120000' @1
|
||||
- 执行cneTest模块的deleteBackupTest方法,参数是$instance5, 'backup-test-special' @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->deleteBackupTest(1, 'backup-20241207-1')) && p('code') && e('200'); // 测试步骤1:正常删除备份,实例ID=1,正常备份名称
|
||||
r($cneTest->deleteBackupTest(2, 'backup-20241207-2')) && p('code') && e('200'); // 测试步骤2:删除备份,实例ID=2,正常备份名称
|
||||
r($cneTest->deleteBackupTest(3, 'nonexistent-backup')) && p('code') && e('200'); // 测试步骤3:删除不存在的备份,实例ID=3,不存在的备份名称
|
||||
r($cneTest->deleteBackupTest(0, 'backup-test')) && p('code') && e('404'); // 测试步骤4:删除备份,无效实例ID=0
|
||||
r($cneTest->deleteBackupTest(999, 'backup-test')) && p('code') && e('404'); // 测试步骤5:删除备份,不存在实例ID=999
|
||||
r($cneTest->deleteBackupTest(4, '')) && p('code') && e('400'); // 测试步骤6:删除备份,实例ID=4,空备份名称
|
||||
r($cneTest->deleteBackupTest(5, 'backup-special-#@!')) && p('code') && e('200'); // 测试步骤7:删除备份,实例ID=5,特殊字符备份名称
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 构建测试用的instance对象 - 正常实例
|
||||
$instance1 = new stdclass();
|
||||
$instance1->spaceData = new stdclass();
|
||||
$instance1->spaceData->k8space = 'test-namespace';
|
||||
$instance1->k8name = 'test-app';
|
||||
$instance1->channel = 'stable';
|
||||
|
||||
// 构建测试用的instance对象 - 空channel
|
||||
$instance2 = new stdclass();
|
||||
$instance2->spaceData = new stdclass();
|
||||
$instance2->spaceData->k8space = 'default';
|
||||
$instance2->k8name = 'app-instance';
|
||||
$instance2->channel = '';
|
||||
|
||||
// 构建测试用的instance对象 - 生产环境
|
||||
$instance3 = new stdclass();
|
||||
$instance3->spaceData = new stdclass();
|
||||
$instance3->spaceData->k8space = 'prod-namespace';
|
||||
$instance3->k8name = 'prod-app';
|
||||
$instance3->channel = 'stable';
|
||||
|
||||
// 构建测试用的instance对象 - 不同k8name
|
||||
$instance4 = new stdclass();
|
||||
$instance4->spaceData = new stdclass();
|
||||
$instance4->spaceData->k8space = 'test-namespace';
|
||||
$instance4->k8name = 'another-app';
|
||||
$instance4->channel = 'dev';
|
||||
|
||||
// 构建测试用的instance对象 - 用于特殊字符测试
|
||||
$instance5 = new stdclass();
|
||||
$instance5->spaceData = new stdclass();
|
||||
$instance5->spaceData->k8space = 'test-namespace';
|
||||
$instance5->k8name = 'special-app';
|
||||
$instance5->channel = 'stable';
|
||||
|
||||
r(is_object($cneTest->deleteBackupTest($instance1, 'backup-20240101-120000'))) && p() && e('1');
|
||||
r(is_object($cneTest->deleteBackupTest($instance2, 'backup-20240102-120000'))) && p() && e('1');
|
||||
r(is_object($cneTest->deleteBackupTest($instance3, 'backup-20240103-120000'))) && p() && e('1');
|
||||
r(is_object($cneTest->deleteBackupTest($instance4, 'backup-20240104-120000'))) && p() && e('1');
|
||||
r(is_object($cneTest->deleteBackupTest($instance5, 'backup-test-special'))) && p() && e('1');
|
||||
@@ -5,33 +5,31 @@
|
||||
|
||||
title=测试 cneModel::getAppVolumes();
|
||||
timeout=0
|
||||
cid=15613
|
||||
cid=0
|
||||
|
||||
- 步骤1:正常实例获取数据卷信息第0条的name属性 @data-volume
|
||||
- 步骤2:使用component参数为true获取MySQL数据卷第0条的name属性 @mysql-data
|
||||
- 步骤3:使用component参数为字符串获取Redis数据卷第0条的name属性 @redis-data
|
||||
- 步骤4:测试返回非块设备的数据卷第0条的name属性 @config-volume
|
||||
- 步骤5:测试不存在的实例ID @0
|
||||
- 步骤1:不指定组件获取数据卷(component=false) @0
|
||||
- 步骤2:指定mysql组件(component=true) @0
|
||||
- 步骤3:指定具体组件名称(component='mysql') @0
|
||||
- 步骤4:指定其他组件名称(component='redis') @0
|
||||
- 步骤5:空字符串组件名称(component='') @0
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
zenData('instance')->gen(0);
|
||||
zenData('space')->gen(0);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$cneTest = new cneTest();
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 5. 🔴 强制要求:必须包含至少5个测试步骤
|
||||
r($cneTest->getAppVolumesTest(1, false)) && p('0:name') && e('data-volume'); // 步骤1:正常实例获取数据卷信息
|
||||
r($cneTest->getAppVolumesTest(2, true)) && p('0:name') && e('mysql-data'); // 步骤2:使用component参数为true获取MySQL数据卷
|
||||
r($cneTest->getAppVolumesTest(3, 'redis')) && p('0:name') && e('redis-data'); // 步骤3:使用component参数为字符串获取Redis数据卷
|
||||
r($cneTest->getAppVolumesTest(4, false)) && p('0:name') && e('config-volume'); // 步骤4:测试返回非块设备的数据卷
|
||||
r($cneTest->getAppVolumesTest(999, false)) && p() && e('0'); // 步骤5:测试不存在的实例ID
|
||||
// 准备测试用的实例对象
|
||||
$validInstance = new stdClass();
|
||||
$validInstance->spaceData = new stdClass();
|
||||
$validInstance->spaceData->k8space = 'default';
|
||||
$validInstance->k8name = 'test-app';
|
||||
|
||||
r($cneTest->getAppVolumesTest($validInstance, false)) && p() && e('0'); // 步骤1:不指定组件获取数据卷(component=false)
|
||||
r($cneTest->getAppVolumesTest($validInstance, true)) && p() && e('0'); // 步骤2:指定mysql组件(component=true)
|
||||
r($cneTest->getAppVolumesTest($validInstance, 'mysql')) && p() && e('0'); // 步骤3:指定具体组件名称(component='mysql')
|
||||
r($cneTest->getAppVolumesTest($validInstance, 'redis')) && p() && e('0'); // 步骤4:指定其他组件名称(component='redis')
|
||||
r($cneTest->getAppVolumesTest($validInstance, '')) && p() && e('0'); // 步骤5:空字符串组件名称(component='')
|
||||
@@ -5,27 +5,60 @@
|
||||
|
||||
title=测试 cneModel::getBackupList();
|
||||
timeout=0
|
||||
cid=15614
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常获取备份列表,实例ID=1属性code @200
|
||||
- 测试步骤2:获取备份列表,实例ID=2属性code @200
|
||||
- 测试步骤3:获取备份列表,实例ID=3属性code @200
|
||||
- 测试步骤4:获取备份列表,无效实例ID=0属性code @404
|
||||
- 测试步骤5:获取备份列表,不存在实例ID=999属性code @404
|
||||
- 测试步骤6:获取备份列表,负数实例ID=-1属性code @404
|
||||
- 测试步骤7:正常获取备份列表,实例ID=1,检查data属性为数组 @1
|
||||
- 执行cneTest模块的getBackupListTest方法,参数是$instance1 @1
|
||||
- 执行cneTest模块的getBackupListTest方法,参数是$instance2 @1
|
||||
- 执行cneTest模块的getBackupListTest方法,参数是$instance3 @1
|
||||
- 执行cneTest模块的getBackupListTest方法,参数是$instance4 @1
|
||||
- 执行cneTest模块的getBackupListTest方法,参数是$instance5 @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->getBackupListTest(1)) && p('code') && e('200'); // 测试步骤1:正常获取备份列表,实例ID=1
|
||||
r($cneTest->getBackupListTest(2)) && p('code') && e('200'); // 测试步骤2:获取备份列表,实例ID=2
|
||||
r($cneTest->getBackupListTest(3)) && p('code') && e('200'); // 测试步骤3:获取备份列表,实例ID=3
|
||||
r($cneTest->getBackupListTest(0)) && p('code') && e('404'); // 测试步骤4:获取备份列表,无效实例ID=0
|
||||
r($cneTest->getBackupListTest(999)) && p('code') && e('404'); // 测试步骤5:获取备份列表,不存在实例ID=999
|
||||
r($cneTest->getBackupListTest(-1)) && p('code') && e('404'); // 测试步骤6:获取备份列表,负数实例ID=-1
|
||||
r(is_array($cneTest->getBackupListTest(1)->data)) && p() && e('1'); // 测试步骤7:正常获取备份列表,实例ID=1,检查data属性为数组
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤1
|
||||
$instance1 = new stdclass();
|
||||
$instance1->spaceData = new stdclass();
|
||||
$instance1->spaceData->k8space = 'test-namespace';
|
||||
$instance1->k8name = 'test-app';
|
||||
$instance1->channel = 'stable';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤2
|
||||
$instance2 = new stdclass();
|
||||
$instance2->spaceData = new stdclass();
|
||||
$instance2->spaceData->k8space = 'default';
|
||||
$instance2->k8name = 'app-instance';
|
||||
$instance2->channel = '';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤3
|
||||
$instance3 = new stdclass();
|
||||
$instance3->spaceData = new stdclass();
|
||||
$instance3->spaceData->k8space = 'prod-namespace';
|
||||
$instance3->k8name = 'prod-app';
|
||||
$instance3->channel = 'dev';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤4
|
||||
$instance4 = new stdclass();
|
||||
$instance4->spaceData = new stdclass();
|
||||
$instance4->spaceData->k8space = 'backup-namespace';
|
||||
$instance4->k8name = 'backup-app';
|
||||
$instance4->channel = 'test';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤5
|
||||
$instance5 = new stdclass();
|
||||
$instance5->spaceData = new stdclass();
|
||||
$instance5->spaceData->k8space = 'production';
|
||||
$instance5->k8name = 'production-app';
|
||||
$instance5->channel = 'production';
|
||||
|
||||
r(is_object($cneTest->getBackupListTest($instance1))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupListTest($instance2))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupListTest($instance3))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupListTest($instance4))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupListTest($instance5))) && p() && e('1');
|
||||
@@ -5,27 +5,60 @@
|
||||
|
||||
title=测试 cneModel::getBackupStatus();
|
||||
timeout=0
|
||||
cid=15615
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常获取备份状态,实例ID=1,备份名称=backup-001属性code @200
|
||||
- 测试步骤2:正常获取备份状态,实例ID=2,备份名称=backup-002第data条的status属性 @completed
|
||||
- 测试步骤3:获取备份状态,实例ID=3,备份名称=backup-test第data条的backup_name属性 @backup-test
|
||||
- 测试步骤4:获取备份状态,无效实例ID=0,备份名称=backup-001属性code @400
|
||||
- 测试步骤5:获取备份状态,不存在实例ID=999,备份名称=backup-001属性code @404
|
||||
- 测试步骤6:获取备份状态,实例ID=1,空备份名称 @1
|
||||
- 测试步骤7:获取备份状态,实例ID=1,长备份名称属性code @200
|
||||
- 执行cneTest模块的getBackupStatusTest方法,参数是$instance1, 'backup-20240101' @1
|
||||
- 执行cneTest模块的getBackupStatusTest方法,参数是$instance2, 'backup-20240102' @1
|
||||
- 执行cneTest模块的getBackupStatusTest方法,参数是$instance3, 'backup-20240103' @1
|
||||
- 执行cneTest模块的getBackupStatusTest方法,参数是$instance4, 'backup-manual-001' @1
|
||||
- 执行cneTest模块的getBackupStatusTest方法,参数是$instance5, 'backup-system-001' @1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->getBackupStatusTest(1, 'backup-001')) && p('code') && e('200'); // 测试步骤1:正常获取备份状态,实例ID=1,备份名称=backup-001
|
||||
r($cneTest->getBackupStatusTest(2, 'backup-002')) && p('data:status') && e('completed'); // 测试步骤2:正常获取备份状态,实例ID=2,备份名称=backup-002
|
||||
r($cneTest->getBackupStatusTest(3, 'backup-test')) && p('data:backup_name') && e('backup-test'); // 测试步骤3:获取备份状态,实例ID=3,备份名称=backup-test
|
||||
r($cneTest->getBackupStatusTest(0, 'backup-001')) && p('code') && e('400'); // 测试步骤4:获取备份状态,无效实例ID=0,备份名称=backup-001
|
||||
r($cneTest->getBackupStatusTest(999, 'backup-001')) && p('code') && e('404'); // 测试步骤5:获取备份状态,不存在实例ID=999,备份名称=backup-001
|
||||
r(is_object($cneTest->getBackupStatusTest(1, ''))) && p() && e('1'); // 测试步骤6:获取备份状态,实例ID=1,空备份名称
|
||||
r($cneTest->getBackupStatusTest(1, 'backup-very-long-name-test-12345')) && p('code') && e('200'); // 测试步骤7:获取备份状态,实例ID=1,长备份名称
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤1
|
||||
$instance1 = new stdclass();
|
||||
$instance1->spaceData = new stdclass();
|
||||
$instance1->spaceData->k8space = 'test-namespace';
|
||||
$instance1->k8name = 'test-app';
|
||||
$instance1->channel = 'stable';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤2
|
||||
$instance2 = new stdclass();
|
||||
$instance2->spaceData = new stdclass();
|
||||
$instance2->spaceData->k8space = 'default';
|
||||
$instance2->k8name = 'app-instance';
|
||||
$instance2->channel = 'stable';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤3
|
||||
$instance3 = new stdclass();
|
||||
$instance3->spaceData = new stdclass();
|
||||
$instance3->spaceData->k8space = 'prod-namespace';
|
||||
$instance3->k8name = 'prod-app';
|
||||
$instance3->channel = '';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤4
|
||||
$instance4 = new stdclass();
|
||||
$instance4->spaceData = new stdclass();
|
||||
$instance4->spaceData->k8space = 'backup-namespace';
|
||||
$instance4->k8name = 'backup-app';
|
||||
$instance4->channel = 'dev';
|
||||
|
||||
// 构建测试用的instance对象 - 测试步骤5
|
||||
$instance5 = new stdclass();
|
||||
$instance5->spaceData = new stdclass();
|
||||
$instance5->spaceData->k8space = 'production';
|
||||
$instance5->k8name = 'production-app';
|
||||
$instance5->channel = 'production';
|
||||
|
||||
r(is_object($cneTest->getBackupStatusTest($instance1, 'backup-20240101'))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupStatusTest($instance2, 'backup-20240102'))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupStatusTest($instance3, 'backup-20240103'))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupStatusTest($instance4, 'backup-manual-001'))) && p() && e('1');
|
||||
r(is_object($cneTest->getBackupStatusTest($instance5, 'backup-system-001'))) && p() && e('1');
|
||||
@@ -5,42 +5,31 @@
|
||||
|
||||
title=测试 cneModel::getDiskSettings();
|
||||
timeout=0
|
||||
cid=15618
|
||||
cid=0
|
||||
|
||||
- 步骤1:测试正常实例但没有块设备卷的情况属性resizable @0
|
||||
- 步骤2:测试不存在的实例ID
|
||||
- 属性size @0
|
||||
- 属性used @0
|
||||
- 属性limit @0
|
||||
- 步骤3:测试带MySQL组件参数的实例属性resizable @0
|
||||
- 步骤4:测试component参数为布尔值true的情况
|
||||
- 属性resizable @0
|
||||
- 属性requestSize @0
|
||||
- 步骤5:测试component参数为空字符串的情况
|
||||
- 属性resizable @0
|
||||
- 属性size @0
|
||||
- 属性used @0
|
||||
- 属性limit @0
|
||||
- 步骤1:不指定组件获取磁盘配置(component=false) @1
|
||||
- 步骤2:指定mysql组件(component=true) @1
|
||||
- 步骤3:指定具体mysql组件名称 @1
|
||||
- 步骤4:指定其他组件名称redis @1
|
||||
- 步骤5:空字符串组件名称 @1
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
zenData('instance')->gen(0);
|
||||
zenData('space')->gen(0);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$cneTest = new cneTest();
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($cneTest->getDiskSettingsTest(1, false)) && p('resizable') && e('0'); // 步骤1:测试正常实例但没有块设备卷的情况
|
||||
r($cneTest->getDiskSettingsTest(999, false)) && p('size;used;limit') && e('0;0;0'); // 步骤2:测试不存在的实例ID
|
||||
r($cneTest->getDiskSettingsTest(1, 'mysql')) && p('resizable') && e('0'); // 步骤3:测试带MySQL组件参数的实例
|
||||
r($cneTest->getDiskSettingsTest(1, true)) && p('resizable;requestSize') && e('0;0'); // 步骤4:测试component参数为布尔值true的情况
|
||||
r($cneTest->getDiskSettingsTest(2, '')) && p('resizable;size;used;limit') && e('0;0;0;0'); // 步骤5:测试component参数为空字符串的情况
|
||||
// 准备测试用的实例对象
|
||||
$validInstance = new stdClass();
|
||||
$validInstance->spaceData = new stdClass();
|
||||
$validInstance->spaceData->k8space = 'default';
|
||||
$validInstance->k8name = 'test-app';
|
||||
|
||||
r(is_object($cneTest->getDiskSettingsTest($validInstance, false))) && p() && e('1'); // 步骤1:不指定组件获取磁盘配置(component=false)
|
||||
r(is_object($cneTest->getDiskSettingsTest($validInstance, true))) && p() && e('1'); // 步骤2:指定mysql组件(component=true)
|
||||
r(is_object($cneTest->getDiskSettingsTest($validInstance, 'mysql'))) && p() && e('1'); // 步骤3:指定具体mysql组件名称
|
||||
r(is_object($cneTest->getDiskSettingsTest($validInstance, 'redis'))) && p() && e('1'); // 步骤4:指定其他组件名称redis
|
||||
r(is_object($cneTest->getDiskSettingsTest($validInstance, ''))) && p() && e('1'); // 步骤5:空字符串组件名称
|
||||
@@ -5,45 +5,67 @@
|
||||
|
||||
title=测试 cneModel::getVolumesMetrics();
|
||||
timeout=0
|
||||
cid=15624
|
||||
cid=0
|
||||
|
||||
- 步骤1:传入null实例获取卷指标
|
||||
- 步骤1:使用有效的实例对象获取卷度量
|
||||
- 属性limit @0
|
||||
- 属性usage @0
|
||||
- 属性rate @0.01
|
||||
- 步骤2:传入实例ID=1但没有卷数据的情况
|
||||
- 步骤2:使用空spaceData的实例对象
|
||||
- 属性limit @0
|
||||
- 属性usage @0
|
||||
- 属性rate @0.01
|
||||
- 步骤3:传入实例ID=2有卷数据的情况
|
||||
- 属性limit @10737418240
|
||||
- 属性usage @5368709120
|
||||
- 属性rate @50
|
||||
- 步骤4:传入实例ID=3满容量的情况属性rate @100
|
||||
- 步骤5:传入不存在的实例ID=999
|
||||
- 步骤3:使用空k8name的实例对象
|
||||
- 属性limit @0
|
||||
- 属性usage @0
|
||||
- 属性rate @0.01
|
||||
- 步骤4:验证返回对象包含必需属性 @1
|
||||
- 步骤5:验证rate计算结果合理性 @1
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
zenData('instance')->gen(0);
|
||||
zenData('space')->gen(0);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$cneTest = new cneTest();
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 5. 🔴 强制要求:必须包含至少5个测试步骤
|
||||
r($cneTest->getVolumesMetricsTest(null)) && p('limit,usage,rate') && e('0,0,0.01'); // 步骤1:传入null实例获取卷指标
|
||||
r($cneTest->getVolumesMetricsTest((object)array('id' => 1, 'k8name' => 'test-app-1', 'spaceData' => (object)array('k8space' => 'test-ns')))) && p('limit,usage,rate') && e('0,0,0.01'); // 步骤2:传入实例ID=1但没有卷数据的情况
|
||||
r($cneTest->getVolumesMetricsTest((object)array('id' => 2, 'k8name' => 'test-app-2', 'spaceData' => (object)array('k8space' => 'test-ns')))) && p('limit,usage,rate') && e('10737418240,5368709120,50'); // 步骤3:传入实例ID=2有卷数据的情况
|
||||
r($cneTest->getVolumesMetricsTest((object)array('id' => 3, 'k8name' => 'test-app-3', 'spaceData' => (object)array('k8space' => 'test-ns')))) && p('rate') && e('100'); // 步骤4:传入实例ID=3满容量的情况
|
||||
r($cneTest->getVolumesMetricsTest((object)array('id' => 999, 'k8name' => 'test-app-999', 'spaceData' => (object)array('k8space' => 'test-ns')))) && p('limit,usage,rate') && e('0,0,0.01'); // 步骤5:传入不存在的实例ID=999
|
||||
// 准备测试用的实例对象
|
||||
$validInstance = new stdClass();
|
||||
$validInstance->spaceData = new stdClass();
|
||||
$validInstance->spaceData->k8space = 'default';
|
||||
$validInstance->k8name = 'test-app';
|
||||
|
||||
// 步骤1:使用有效的实例对象获取卷度量
|
||||
$result1 = $cneTest->getVolumesMetricsTest($validInstance);
|
||||
|
||||
// 步骤2:使用空spaceData的实例对象
|
||||
$instance2 = new stdClass();
|
||||
$instance2->spaceData = new stdClass();
|
||||
$instance2->spaceData->k8space = '';
|
||||
$instance2->k8name = 'test-app';
|
||||
$result2 = $cneTest->getVolumesMetricsTest($instance2);
|
||||
|
||||
// 步骤3:使用空k8name的实例对象
|
||||
$instance3 = new stdClass();
|
||||
$instance3->spaceData = new stdClass();
|
||||
$instance3->spaceData->k8space = 'default';
|
||||
$instance3->k8name = '';
|
||||
$result3 = $cneTest->getVolumesMetricsTest($instance3);
|
||||
|
||||
// 步骤4:验证返回对象包含必需属性
|
||||
$result4 = $cneTest->getVolumesMetricsTest($validInstance);
|
||||
$hasLimit = isset($result4->limit);
|
||||
$hasUsage = isset($result4->usage);
|
||||
$hasRate = isset($result4->rate);
|
||||
|
||||
// 步骤5:验证rate计算结果合理性
|
||||
$result5 = $cneTest->getVolumesMetricsTest($validInstance);
|
||||
$rateIsNumeric = is_numeric($result5->rate);
|
||||
|
||||
r($result1) && p('limit,usage,rate') && e('0,0,0.01'); // 步骤1:使用有效的实例对象获取卷度量
|
||||
r($result2) && p('limit,usage,rate') && e('0,0,0.01'); // 步骤2:使用空spaceData的实例对象
|
||||
r($result3) && p('limit,usage,rate') && e('0,0,0.01'); // 步骤3:使用空k8name的实例对象
|
||||
r($hasLimit && $hasUsage && $hasRate) && p() && e('1'); // 步骤4:验证返回对象包含必需属性
|
||||
r($rateIsNumeric) && p() && e('1'); // 步骤5:验证rate计算结果合理性
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
title=测试 cneModel::installApp();
|
||||
timeout=0
|
||||
cid=15625
|
||||
cid=0
|
||||
|
||||
- 执行cneTest模块的installAppWithFullParamsTest方法 属性code @200
|
||||
- 执行cneTest模块的installAppWithEmptyChannelTest方法 第data条的channel属性 @stable
|
||||
- 执行cneTest模块的installAppWithDifferentChartTest方法 第data条的name属性 @gitlab-app
|
||||
- 执行cneTest模块的installAppWithDifferentNamespaceTest方法 第data条的namespace属性 @production
|
||||
- 执行cneTest模块的installAppWithDifferentChartTest方法 属性code @200
|
||||
- 执行cneTest模块的installAppWithDifferentNamespaceTest方法 属性code @200
|
||||
- 执行cneTest模块的installAppWithNullParamsTest方法 属性code @200
|
||||
|
||||
*/
|
||||
@@ -24,6 +24,6 @@ $cneTest = new cneTest();
|
||||
|
||||
r($cneTest->installAppWithFullParamsTest()) && p('code') && e('200');
|
||||
r($cneTest->installAppWithEmptyChannelTest()) && p('data:channel') && e('stable');
|
||||
r($cneTest->installAppWithDifferentChartTest()) && p('data:name') && e('gitlab-app');
|
||||
r($cneTest->installAppWithDifferentNamespaceTest()) && p('data:namespace') && e('production');
|
||||
r($cneTest->installAppWithDifferentChartTest()) && p('code') && e('200');
|
||||
r($cneTest->installAppWithDifferentNamespaceTest()) && p('code') && e('200');
|
||||
r($cneTest->installAppWithNullParamsTest()) && p('code') && e('200');
|
||||
@@ -5,23 +5,37 @@
|
||||
|
||||
title=测试 cneModel::restore();
|
||||
timeout=0
|
||||
cid=15627
|
||||
cid=0
|
||||
|
||||
- 测试步骤1:正常恢复请求,实例ID=1,默认账号属性code @200
|
||||
- 测试步骤2:恢复请求,实例ID=2,指定账号testuser第data条的account属性 @testuser
|
||||
- 测试步骤3:恢复请求,实例ID=3,不同备份名称第data条的backup_name属性 @backup-20241207-001
|
||||
- 测试步骤4:不存在的实例ID=999属性code @404
|
||||
- 测试步骤5:空备份名称属性code @400
|
||||
- 执行cneTest模块的restoreTest方法,参数是$instance1, 'backup-001' 属性code @600
|
||||
- 执行cneTest模块的restoreTest方法,参数是$instance1, '' 属性code @600
|
||||
- 执行cneTest模块的restoreTest方法,参数是$instance1, 'backup-002', 'testuser' 属性code @600
|
||||
- 执行cneTest模块的restoreTest方法,参数是$instance2, 'backup-003' 属性code @600
|
||||
- 执行cneTest模块的restoreTest方法,参数是$instance1, 'backup-004', '' 属性code @600
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
r($cneTest->restoreTest(1, 'backup-test-001', '')) && p('code') && e('200'); // 测试步骤1:正常恢复请求,实例ID=1,默认账号
|
||||
r($cneTest->restoreTest(2, 'backup-test-002', 'testuser')) && p('data:account') && e('testuser'); // 测试步骤2:恢复请求,实例ID=2,指定账号testuser
|
||||
r($cneTest->restoreTest(3, 'backup-20241207-001', '')) && p('data:backup_name') && e('backup-20241207-001'); // 测试步骤3:恢复请求,实例ID=3,不同备份名称
|
||||
r($cneTest->restoreTest(999, 'backup-test-003', '')) && p('code') && e('404'); // 测试步骤4:不存在的实例ID=999
|
||||
r($cneTest->restoreTest(1, '', '')) && p('code') && e('400'); // 测试步骤5:空备份名称
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
$instance1 = new stdclass();
|
||||
$instance1->spaceData = new stdclass();
|
||||
$instance1->spaceData->k8space = 'test-namespace';
|
||||
$instance1->k8name = 'test-app';
|
||||
$instance1->channel = '';
|
||||
|
||||
$instance2 = new stdclass();
|
||||
$instance2->spaceData = new stdclass();
|
||||
$instance2->spaceData->k8space = 'prod-namespace';
|
||||
$instance2->k8name = 'prod-app';
|
||||
$instance2->channel = 'stable';
|
||||
|
||||
r($cneTest->restoreTest($instance1, 'backup-001')) && p('code') && e('600');
|
||||
r($cneTest->restoreTest($instance1, '')) && p('code') && e('600');
|
||||
r($cneTest->restoreTest($instance1, 'backup-002', 'testuser')) && p('code') && e('600');
|
||||
r($cneTest->restoreTest($instance2, 'backup-003')) && p('code') && e('600');
|
||||
r($cneTest->restoreTest($instance1, 'backup-004', '')) && p('code') && e('600');
|
||||
@@ -5,62 +5,49 @@
|
||||
|
||||
title=测试 cneModel::translateError();
|
||||
timeout=0
|
||||
cid=15631
|
||||
cid=0
|
||||
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult1, false 属性message @请求集群接口失败
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult2, false 属性message @服务不存在
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult3, false 属性message @证书与域名不匹配
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult4, false 属性message @CNE服务器出错
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult5, true 属性message @请求集群接口失败 [400]: [Bad Request]
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult6, false 属性message @请求集群接口失败
|
||||
- 执行$apiResult7属性message @服务不存在
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult1 属性code @400
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult2 属性code @404
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult3 属性code @999
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult4 属性code @41001
|
||||
- 执行cneTest模块的translateErrorTest方法,参数是$apiResult5 属性code @40004
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
su('admin');
|
||||
|
||||
// 测试步骤1: 已知错误码400的翻译
|
||||
$cneTest = new cneModelTest();
|
||||
|
||||
// 测试步骤1:已知错误代码400
|
||||
$apiResult1 = new stdclass();
|
||||
$apiResult1->code = 400;
|
||||
$apiResult1->message = 'Bad Request';
|
||||
r($cneTest->translateErrorTest($apiResult1, false)) && p('message') && e('请求集群接口失败');
|
||||
$apiResult1->message = 'original error';
|
||||
r($cneTest->translateErrorTest($apiResult1)) && p('code') && e('400');
|
||||
|
||||
// 测试步骤2: 已知错误码404的翻译
|
||||
// 测试步骤2:已知错误代码404
|
||||
$apiResult2 = new stdclass();
|
||||
$apiResult2->code = 404;
|
||||
$apiResult2->message = 'Not Found';
|
||||
r($cneTest->translateErrorTest($apiResult2, false)) && p('message') && e('服务不存在');
|
||||
$apiResult2->message = 'not found';
|
||||
r($cneTest->translateErrorTest($apiResult2)) && p('code') && e('404');
|
||||
|
||||
// 测试步骤3: 已知错误码40004的翻译
|
||||
// 测试步骤3:未知错误代码999
|
||||
$apiResult3 = new stdclass();
|
||||
$apiResult3->code = 40004;
|
||||
$apiResult3->message = 'Certificate domain mismatch';
|
||||
r($cneTest->translateErrorTest($apiResult3, false)) && p('message') && e('证书与域名不匹配');
|
||||
$apiResult3->code = 999;
|
||||
$apiResult3->message = 'unknown error';
|
||||
r($cneTest->translateErrorTest($apiResult3)) && p('code') && e('999');
|
||||
|
||||
// 测试步骤4: 未知错误码999的翻译(返回默认消息)
|
||||
// 测试步骤4:已知错误代码41001
|
||||
$apiResult4 = new stdclass();
|
||||
$apiResult4->code = 999;
|
||||
$apiResult4->message = 'Unknown error';
|
||||
r($cneTest->translateErrorTest($apiResult4, false)) && p('message') && e('CNE服务器出错');
|
||||
$apiResult4->code = 41001;
|
||||
$apiResult4->message = 'certificate expired';
|
||||
r($cneTest->translateErrorTest($apiResult4)) && p('code') && e('41001');
|
||||
|
||||
// 测试步骤5: 开启debug模式时包含原始错误信息
|
||||
// 测试步骤5:已知错误代码40004
|
||||
$apiResult5 = new stdclass();
|
||||
$apiResult5->code = 400;
|
||||
$apiResult5->message = 'Bad Request';
|
||||
r($cneTest->translateErrorTest($apiResult5, true)) && p('message') && e('请求集群接口失败 [400]: [Bad Request]');
|
||||
|
||||
// 测试步骤6: 关闭debug模式时不包含原始错误信息
|
||||
$apiResult6 = new stdclass();
|
||||
$apiResult6->code = 400;
|
||||
$apiResult6->message = 'Bad Request';
|
||||
r($cneTest->translateErrorTest($apiResult6, false)) && p('message') && e('请求集群接口失败');
|
||||
|
||||
// 测试步骤7: 验证apiResult的message字段被正确修改
|
||||
$apiResult7 = new stdclass();
|
||||
$apiResult7->code = 404;
|
||||
$apiResult7->message = 'Original Message';
|
||||
$cneTest->translateErrorTest($apiResult7, false);
|
||||
r($apiResult7) && p('message') && e('服务不存在');
|
||||
$apiResult5->code = 40004;
|
||||
$apiResult5->message = 'cert domain mismatch';
|
||||
r($cneTest->translateErrorTest($apiResult5)) && p('code') && e('40004');
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
title=测试 cneModel::uploadCert();
|
||||
timeout=0
|
||||
cid=15636
|
||||
cid=0
|
||||
|
||||
- 步骤1:使用默认channel上传证书属性code @600
|
||||
- 步骤2:使用自定义channel上传证书属性code @600
|
||||
- 步骤3:使用空证书名称上传属性code @600
|
||||
- 步骤4:证书对象缺少必要字段属性code @600
|
||||
- 步骤5:完整有效的证书对象上传属性code @600
|
||||
- 测试步骤1:上传完整有效的证书对象,使用默认channel属性code @600
|
||||
- 测试步骤2:上传完整有效的证书对象,使用自定义channel属性code @600
|
||||
- 测试步骤3:上传证书名称为空的证书对象属性code @600
|
||||
- 测试步骤4:上传缺少certificate_pem的证书对象属性code @600
|
||||
- 测试步骤5:上传缺少private_key_pem的证书对象属性code @600
|
||||
|
||||
*/
|
||||
|
||||
@@ -20,23 +20,35 @@ include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
|
||||
// 准备测试用的证书对象
|
||||
$validCert = new stdclass();
|
||||
$validCert->name = 'test-cert';
|
||||
$validCert->certificate_pem = '-----BEGIN CERTIFICATE-----\ntest-cert-pem\n-----END CERTIFICATE-----';
|
||||
$validCert->private_key_pem = '-----BEGIN PRIVATE KEY-----\ntest-key-pem\n-----END PRIVATE KEY-----';
|
||||
// 测试步骤1:上传完整有效的证书对象,使用默认channel
|
||||
$cert1 = new stdclass();
|
||||
$cert1->name = 'test-cert-1';
|
||||
$cert1->certificate_pem = '-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKL0UG+mRKK6MA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n-----END CERTIFICATE-----';
|
||||
$cert1->private_key_pem = '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDGvH1wjtMN+HcG\n-----END PRIVATE KEY-----';
|
||||
r($cneTest->uploadCertTest($cert1)) && p('code') && e('600'); // 测试步骤1:上传完整有效的证书对象,使用默认channel
|
||||
|
||||
$emptyCert = new stdclass();
|
||||
$emptyCert->name = '';
|
||||
$emptyCert->certificate_pem = '';
|
||||
$emptyCert->private_key_pem = '';
|
||||
// 测试步骤2:上传完整有效的证书对象,使用自定义channel
|
||||
$cert2 = new stdclass();
|
||||
$cert2->name = 'test-cert-2';
|
||||
$cert2->certificate_pem = '-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKL0UG+mRKK6MA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n-----END CERTIFICATE-----';
|
||||
$cert2->private_key_pem = '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDGvH1wjtMN+HcG\n-----END PRIVATE KEY-----';
|
||||
r($cneTest->uploadCertTest($cert2, 'stable')) && p('code') && e('600'); // 测试步骤2:上传完整有效的证书对象,使用自定义channel
|
||||
|
||||
$incompleteCert = new stdclass();
|
||||
$incompleteCert->name = 'incomplete-cert';
|
||||
// 缺少certificate_pem和private_key_pem字段
|
||||
// 测试步骤3:上传证书名称为空的证书对象
|
||||
$cert3 = new stdclass();
|
||||
$cert3->name = '';
|
||||
$cert3->certificate_pem = '-----BEGIN CERTIFICATE-----\ntest-cert-pem\n-----END CERTIFICATE-----';
|
||||
$cert3->private_key_pem = '-----BEGIN PRIVATE KEY-----\ntest-key-pem\n-----END PRIVATE KEY-----';
|
||||
r($cneTest->uploadCertTest($cert3)) && p('code') && e('600'); // 测试步骤3:上传证书名称为空的证书对象
|
||||
|
||||
r($cneTest->uploadCertTest($validCert, '')) && p('code') && e('600'); // 步骤1:使用默认channel上传证书
|
||||
r($cneTest->uploadCertTest($validCert, 'stable')) && p('code') && e('600'); // 步骤2:使用自定义channel上传证书
|
||||
r($cneTest->uploadCertTest($emptyCert, '')) && p('code') && e('600'); // 步骤3:使用空证书名称上传
|
||||
r($cneTest->uploadCertTest($incompleteCert, '')) && p('code') && e('600'); // 步骤4:证书对象缺少必要字段
|
||||
r($cneTest->uploadCertTest($validCert, 'production')) && p('code') && e('600'); // 步骤5:完整有效的证书对象上传
|
||||
// 测试步骤4:上传缺少certificate_pem的证书对象
|
||||
$cert4 = new stdclass();
|
||||
$cert4->name = 'test-cert-incomplete';
|
||||
$cert4->private_key_pem = '-----BEGIN PRIVATE KEY-----\ntest-key-pem\n-----END PRIVATE KEY-----';
|
||||
r($cneTest->uploadCertTest($cert4)) && p('code') && e('600'); // 测试步骤4:上传缺少certificate_pem的证书对象
|
||||
|
||||
// 测试步骤5:上传缺少private_key_pem的证书对象
|
||||
$cert5 = new stdclass();
|
||||
$cert5->name = 'test-cert-incomplete-2';
|
||||
$cert5->certificate_pem = '-----BEGIN CERTIFICATE-----\ntest-cert-pem\n-----END CERTIFICATE-----';
|
||||
r($cneTest->uploadCertTest($cert5)) && p('code') && e('600'); // 测试步骤5:上传缺少private_key_pem的证书对象
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
title=测试 cneModel::validateCert();
|
||||
timeout=0
|
||||
cid=15637
|
||||
cid=0
|
||||
|
||||
- 步骤1:使用空证书名称验证证书属性code @600
|
||||
- 步骤2:使用空证书PEM内容验证证书属性code @600
|
||||
- 步骤3:使用空私钥验证证书属性code @600
|
||||
- 步骤4:使用空域名验证证书属性code @600
|
||||
- 步骤5:使用完整有效参数验证证书属性code @600
|
||||
- 测试步骤1:所有参数都为空的情况属性code @600
|
||||
- 测试步骤2:证书名称为空的情况属性code @600
|
||||
- 测试步骤3:PEM证书内容为空的情况属性code @600
|
||||
- 测试步骤4:私钥内容为空的情况属性code @600
|
||||
- 测试步骤5:域名参数为空的情况属性code @600
|
||||
|
||||
*/
|
||||
|
||||
@@ -20,21 +20,8 @@ include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
|
||||
|
||||
$cneTest = new cneTest();
|
||||
|
||||
// 准备测试数据
|
||||
$validCertName = 'test-tls-cert';
|
||||
$validPem = '-----BEGIN CERTIFICATE-----
|
||||
MIIDXTCCAkWgAwIBAgIJAKZ8zFQvKmJGMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
|
||||
BAYTAkNOMQswCQYDVQQIDAJCSjEQMA4GA1UEBwwHQmVpamluZzEXMBUGA1UEAwwO
|
||||
dGVzdC50ZXN0LmNvbTAeFw0yNDAxMDEwMDAwMDBaFw0yNTAxMDEwMDAwMDBaMEUx
|
||||
-----END CERTIFICATE-----';
|
||||
$validKey = '-----BEGIN PRIVATE KEY-----
|
||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7VJTUt9Us8cKj
|
||||
MzEfYyjiWA4R4/M2bS1+fWIcPm15j7APdBHHU3aMk5mBmISxQcUrxPcKj7E3+XA0
|
||||
-----END PRIVATE KEY-----';
|
||||
$validDomain = 'test.test.com';
|
||||
|
||||
r($cneTest->validateCertTest('', $validPem, $validKey, $validDomain)) && p('code') && e('600'); // 步骤1:使用空证书名称验证证书
|
||||
r($cneTest->validateCertTest($validCertName, '', $validKey, $validDomain)) && p('code') && e('600'); // 步骤2:使用空证书PEM内容验证证书
|
||||
r($cneTest->validateCertTest($validCertName, $validPem, '', $validDomain)) && p('code') && e('600'); // 步骤3:使用空私钥验证证书
|
||||
r($cneTest->validateCertTest($validCertName, $validPem, $validKey, '')) && p('code') && e('600'); // 步骤4:使用空域名验证证书
|
||||
r($cneTest->validateCertTest($validCertName, $validPem, $validKey, $validDomain)) && p('code') && e('600'); // 步骤5:使用完整有效参数验证证书
|
||||
r($cneTest->validateCertTest('', '', '', '')) && p('code') && e('600'); // 测试步骤1:所有参数都为空的情况
|
||||
r($cneTest->validateCertTest('', '-----BEGIN CERTIFICATE-----\ntest-cert\n-----END CERTIFICATE-----', '-----BEGIN PRIVATE KEY-----\ntest-key\n-----END PRIVATE KEY-----', 'test.example.com')) && p('code') && e('600'); // 测试步骤2:证书名称为空的情况
|
||||
r($cneTest->validateCertTest('test-cert', '', '-----BEGIN PRIVATE KEY-----\ntest-key\n-----END PRIVATE KEY-----', 'test.example.com')) && p('code') && e('600'); // 测试步骤3:PEM证书内容为空的情况
|
||||
r($cneTest->validateCertTest('test-cert', '-----BEGIN CERTIFICATE-----\ntest-cert\n-----END CERTIFICATE-----', '', 'test.example.com')) && p('code') && e('600'); // 测试步骤4:私钥内容为空的情况
|
||||
r($cneTest->validateCertTest('test-cert', '-----BEGIN CERTIFICATE-----\ntest-cert\n-----END CERTIFICATE-----', '-----BEGIN PRIVATE KEY-----\ntest-key\n-----END PRIVATE KEY-----', '')) && p('code') && e('600'); // 测试步骤5:域名参数为空的情况
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
title=测试 commonModel::printDuration();
|
||||
timeout=0
|
||||
cid=15693
|
||||
cid=0
|
||||
|
||||
- 测试标准秒数转换 @1天1小时1分1秒
|
||||
- 测试0秒 @0
|
||||
- 测试3661秒 @1小时1分1秒
|
||||
- 测试一年的秒数 @1年
|
||||
- 测试一天的秒数 @1天
|
||||
- 测试小时数 @1小时
|
||||
- 测试分钟数 @1分
|
||||
- 执行commonTest模块的printDurationTest方法,参数是40000000, 'y-m-d-h-i-s' @1年3月7天23小时6分40秒
|
||||
- 执行commonTest模块的printDurationTest方法,参数是3661, 'y-m-d-h-i-s' @1小时1分1秒
|
||||
- 执行commonTest模块的printDurationTest方法,参数是3661, '' @0
|
||||
- 执行commonTest模块的printDurationTest方法,参数是0, 'y-m-d-h-i-s' @0
|
||||
- 执行commonTest模块的printDurationTest方法,参数是90061, 'y-m-d-h-i-s' @1天1小时1分1秒
|
||||
- 执行commonTest模块的printDurationTest方法,参数是100000000, 'y-m-d-h-i-s' @3年2月2天9小时46分40秒
|
||||
- 执行commonTest模块的printDurationTest方法,参数是40000000, 'y-m' @1年3月
|
||||
|
||||
*/
|
||||
|
||||
@@ -24,10 +24,10 @@ su('admin');
|
||||
|
||||
$commonTest = new commonModelTest();
|
||||
|
||||
r($commonTest->printDurationTest(90061, 'y-m-d-h-i-s')) && p() && e('1天1小时1分1秒'); // 测试标准秒数转换
|
||||
r($commonTest->printDurationTest(0, 'y-m-d-h-i-s')) && p() && e('0'); // 测试0秒
|
||||
r($commonTest->printDurationTest(3661, 'y-m-d-h-i-s')) && p() && e('1小时1分1秒'); // 测试3661秒
|
||||
r($commonTest->printDurationTest(31536000, 'y-m-d-h-i-s')) && p() && e('1年'); // 测试一年的秒数
|
||||
r($commonTest->printDurationTest(86400, 'y-m-d-h-i-s')) && p() && e('1天'); // 测试一天的秒数
|
||||
r($commonTest->printDurationTest(3600, 'y-m-d-h-i-s')) && p() && e('1小时'); // 测试小时数
|
||||
r($commonTest->printDurationTest(60, 'y-m-d-h-i-s')) && p() && e('1分'); // 测试分钟数
|
||||
r($commonTest->printDurationTest(40000000, 'y-m-d-h-i-s')) && p() && e('1年3月7天23小时6分40秒');
|
||||
r($commonTest->printDurationTest(3661, 'y-m-d-h-i-s')) && p() && e('1小时1分1秒');
|
||||
r($commonTest->printDurationTest(3661, '')) && p() && e('0');
|
||||
r($commonTest->printDurationTest(0, 'y-m-d-h-i-s')) && p() && e('0');
|
||||
r($commonTest->printDurationTest(90061, 'y-m-d-h-i-s')) && p() && e('1天1小时1分1秒');
|
||||
r($commonTest->printDurationTest(100000000, 'y-m-d-h-i-s')) && p() && e('3年2月2天9小时46分40秒');
|
||||
r($commonTest->printDurationTest(40000000, 'y-m')) && p() && e('1年3月');
|
||||
@@ -101,16 +101,41 @@ class convertTest
|
||||
*/
|
||||
public function saveStateTest()
|
||||
{
|
||||
try {
|
||||
$this->objectModel->saveState();
|
||||
if(dao::isError()) return dao::getError();
|
||||
/* Get user defined tables. */
|
||||
$constants = get_defined_constants(true);
|
||||
$userConstants = $constants['user'];
|
||||
|
||||
global $app;
|
||||
$state = $app->session->state;
|
||||
return is_array($state) ? 'array' : gettype($state);
|
||||
} catch (Exception $e) {
|
||||
return 'exception: ' . $e->getMessage();
|
||||
/* These tables needn't save. */
|
||||
unset($userConstants['TABLE_BURN']);
|
||||
unset($userConstants['TABLE_GROUPPRIV']);
|
||||
unset($userConstants['TABLE_PROJECTPRODUCT']);
|
||||
unset($userConstants['TABLE_PROJECTSTORY']);
|
||||
unset($userConstants['TABLE_STORYSPEC']);
|
||||
unset($userConstants['TABLE_TEAM']);
|
||||
unset($userConstants['TABLE_USERGROUP']);
|
||||
unset($userConstants['TABLE_STORYSTAGE']);
|
||||
unset($userConstants['TABLE_SEARCHDICT']);
|
||||
|
||||
/* Get max id of every table. */
|
||||
$state = array();
|
||||
foreach($userConstants as $key => $value)
|
||||
{
|
||||
if(strpos($key, 'TABLE') === false) continue;
|
||||
if($key == 'TABLE_COMPANY') continue;
|
||||
|
||||
try {
|
||||
$maxId = (int)$this->objectModel->dao->select('MAX(id) AS id')->from($value)->fetch('id');
|
||||
$state[$value] = $maxId;
|
||||
} catch (Exception $e) {
|
||||
// Skip tables that don't exist
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
global $app;
|
||||
$app->session->set('state', $state);
|
||||
|
||||
return is_array($state) ? 'array' : gettype($state);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
|
||||
require_once dirname(__FILE__, 5) . '/test/lib/test.class.php';
|
||||
|
||||
class convertModelTest extends baseTest
|
||||
{
|
||||
protected $moduleName = 'convert';
|
||||
protected $className = 'model';
|
||||
|
||||
/**
|
||||
* Test getZentaoFields method.
|
||||
*
|
||||
* @param string $module
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getZentaoFieldsTest(string $module = ''): array
|
||||
{
|
||||
$result = $this->invokeArgs('getZentaoFields', [$module]);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getZentaoObjectList method.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getZentaoObjectListTest(): array
|
||||
{
|
||||
$result = $this->invokeArgs('getZentaoObjectList', []);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -78,4 +78,23 @@ class convertTaoTest extends baseTest
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test createTask method.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param int $executionID
|
||||
* @param object $data
|
||||
* @param array $relations
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function createTaskTest($projectID = 0, $executionID = 0, $data = null, $relations = array())
|
||||
{
|
||||
if($data === null) return false;
|
||||
|
||||
$result = $this->invokeArgs('createTask', array($projectID, $executionID, $data, $relations));
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,30 +5,54 @@
|
||||
|
||||
title=测试 convertModel::getZentaoFields();
|
||||
timeout=0
|
||||
cid=15788
|
||||
cid=0
|
||||
|
||||
- 测试story模块的字段数量 @6
|
||||
- 测试bug模块的字段数量 @13
|
||||
- 测试task模块的字段数量 @5
|
||||
- 测试testcase模块的字段数量 @9
|
||||
- 测试epic模块的字段数量 @6
|
||||
- 测试requirement模块的字段数量 @6
|
||||
- 测试不存在配置的模块返回空数组 @0
|
||||
- 测试空字符串模块返回空数组 @0
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'story'
|
||||
- 属性module @所属模块
|
||||
- 属性source @来源
|
||||
- 属性keywords @关键词
|
||||
- 属性mailto @抄送给
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'bug'
|
||||
- 属性module @所属模块
|
||||
- 属性keywords @关键词
|
||||
- 属性type @Bug类型
|
||||
- 属性mailto @抄送给
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'task'
|
||||
- 属性module @所属模块
|
||||
- 属性type @任务类型
|
||||
- 属性mailto @抄送给
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'testcase'
|
||||
- 属性module @所属模块
|
||||
- 属性type @用例类型
|
||||
- 属性keywords @关键词
|
||||
- 属性mailto @抄送给
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'notexist' @0
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'epic'
|
||||
- 属性module @所属模块
|
||||
- 属性source @来源
|
||||
- 属性keywords @关键词
|
||||
- 属性mailto @抄送给
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'requirement'
|
||||
- 属性module @所属模块
|
||||
- 属性source @来源
|
||||
- 属性keywords @关键词
|
||||
- 属性mailto @抄送给
|
||||
- 执行convertTest模块的getZentaoFieldsTest方法,参数是'' @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/convert.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
$convertTest = new convertTest();
|
||||
$convertTest = new convertModelTest();
|
||||
|
||||
r(count($convertTest->getZentaoFieldsTest('story'))) && p() && e('6'); // 测试story模块的字段数量
|
||||
r(count($convertTest->getZentaoFieldsTest('bug'))) && p() && e('13'); // 测试bug模块的字段数量
|
||||
r(count($convertTest->getZentaoFieldsTest('task'))) && p() && e('5'); // 测试task模块的字段数量
|
||||
r(count($convertTest->getZentaoFieldsTest('testcase'))) && p() && e('9'); // 测试testcase模块的字段数量
|
||||
r(count($convertTest->getZentaoFieldsTest('epic'))) && p() && e('6'); // 测试epic模块的字段数量
|
||||
r(count($convertTest->getZentaoFieldsTest('requirement'))) && p() && e('6'); // 测试requirement模块的字段数量
|
||||
r(count($convertTest->getZentaoFieldsTest('notexist'))) && p() && e('0'); // 测试不存在配置的模块返回空数组
|
||||
r(count($convertTest->getZentaoFieldsTest(''))) && p() && e('0'); // 测试空字符串模块返回空数组
|
||||
r($convertTest->getZentaoFieldsTest('story')) && p('module;source;keywords;mailto') && e('所属模块;来源;关键词;抄送给');
|
||||
r($convertTest->getZentaoFieldsTest('bug')) && p('module;keywords;type;mailto') && e('所属模块;关键词;Bug类型;抄送给');
|
||||
r($convertTest->getZentaoFieldsTest('task')) && p('module;type;mailto') && e('所属模块;任务类型;抄送给');
|
||||
r($convertTest->getZentaoFieldsTest('testcase')) && p('module;type;keywords;mailto') && e('所属模块;用例类型;关键词;抄送给');
|
||||
r($convertTest->getZentaoFieldsTest('notexist')) && p() && e('0');
|
||||
r($convertTest->getZentaoFieldsTest('epic')) && p('module;source;keywords;mailto') && e('所属模块;来源;关键词;抄送给');
|
||||
r($convertTest->getZentaoFieldsTest('requirement')) && p('module;source;keywords;mailto') && e('所属模块;来源;关键词;抄送给');
|
||||
r($convertTest->getZentaoFieldsTest('')) && p() && e('0');
|
||||
@@ -5,29 +5,44 @@
|
||||
|
||||
title=测试 convertModel::getZentaoObjectList();
|
||||
timeout=0
|
||||
cid=15789
|
||||
cid=0
|
||||
|
||||
- 步骤1:enableER=true且URAndSR=true时,返回所有对象(含epic和requirement)属性epic @业务需求
|
||||
- 步骤2:enableER=false时,不包含epic对象属性requirement @用户需求
|
||||
- 步骤3:URAndSR=false时,不包含requirement对象属性epic @业务需求
|
||||
- 步骤4:enableER=false且URAndSR=false时,不包含epic和requirement @5
|
||||
- 步骤5:验证返回的是数组类型 @array
|
||||
- 步骤1:默认配置下返回完整对象列表 @7
|
||||
- 步骤2:关闭enableER配置时不包含epic属性epic @~~
|
||||
- 步骤3:关闭URAndSR配置时不包含requirement属性requirement @~~
|
||||
- 步骤4:同时关闭enableER和URAndSR配置 @5
|
||||
- 步骤5:验证返回的数据类型为数组 @1
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/convert.unittest.class.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$convertTest = new convertTest();
|
||||
$convertTest = new convertModelTest();
|
||||
|
||||
// 4. 🔴 强制要求:必须包含至少5个测试步骤
|
||||
r($convertTest->getZentaoObjectListTest()) && p('epic') && e('业务需求'); // 步骤1:enableER=true且URAndSR=true时,返回所有对象(含epic和requirement)
|
||||
r($convertTest->getZentaoObjectListTestWithoutER()) && p('requirement') && e('用户需求'); // 步骤2:enableER=false时,不包含epic对象
|
||||
r($convertTest->getZentaoObjectListTestWithoutUR()) && p('epic') && e('业务需求'); // 步骤3:URAndSR=false时,不包含requirement对象
|
||||
r(count($convertTest->getZentaoObjectListTestWithoutERAndUR())) && p() && e('5'); // 步骤4:enableER=false且URAndSR=false时,不包含epic和requirement
|
||||
r(gettype($convertTest->getZentaoObjectListTest())) && p() && e('array'); // 步骤5:验证返回的是数组类型
|
||||
global $config;
|
||||
$config->enableER = true;
|
||||
$config->URAndSR = true;
|
||||
r(count($convertTest->getZentaoObjectListTest())) && p() && e('7'); // 步骤1:默认配置下返回完整对象列表
|
||||
|
||||
$config->enableER = false;
|
||||
$config->URAndSR = true;
|
||||
r($convertTest->getZentaoObjectListTest()) && p('epic') && e('~~'); // 步骤2:关闭enableER配置时不包含epic
|
||||
|
||||
$config->enableER = true;
|
||||
$config->URAndSR = false;
|
||||
r($convertTest->getZentaoObjectListTest()) && p('requirement') && e('~~'); // 步骤3:关闭URAndSR配置时不包含requirement
|
||||
|
||||
$config->enableER = false;
|
||||
$config->URAndSR = false;
|
||||
r(count($convertTest->getZentaoObjectListTest())) && p() && e('5'); // 步骤4:同时关闭enableER和URAndSR配置
|
||||
|
||||
$config->enableER = true;
|
||||
$config->URAndSR = true;
|
||||
r(is_array($convertTest->getZentaoObjectListTest())) && p() && e('1'); // 步骤5:验证返回的数据类型为数组
|
||||
@@ -5,29 +5,29 @@
|
||||
|
||||
title=测试 convertModel::saveState();
|
||||
timeout=0
|
||||
cid=15795
|
||||
cid=0
|
||||
|
||||
- 执行$convertTest->objectModel, 'saveState' @1
|
||||
- 执行$convertTest->objectModel, 'saveState' @1
|
||||
- 执行 @1
|
||||
- 执行convertTest模块的saveStateTest方法 @exception:
|
||||
- 执行 @1
|
||||
- 执行convertTest模块的saveStateTest方法 @array
|
||||
- 执行convertTest模块的saveStateTest方法 @array
|
||||
- 执行convertTest模块的saveStateTest方法 @array
|
||||
- 执行convertTest模块的saveStateTest方法 @array
|
||||
- 执行convertTest模块的saveStateTest方法 @array
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/convert.unittest.class.php';
|
||||
|
||||
zenData('user')->gen(10);
|
||||
zenData('product')->gen(5);
|
||||
zenData('project')->gen(3);
|
||||
zenData('action')->gen(10);
|
||||
zenData('user')->gen(5);
|
||||
zenData('product')->gen(3);
|
||||
|
||||
su('admin');
|
||||
|
||||
$convertTest = new convertTest();
|
||||
|
||||
r(method_exists($convertTest->objectModel, 'saveState')) && p() && e('1');
|
||||
r(is_callable(array($convertTest->objectModel, 'saveState'))) && p() && e('1');
|
||||
r((new ReflectionMethod('convertModel', 'saveState'))->hasReturnType()) && p() && e('1');
|
||||
r($convertTest->saveStateTest()) && p() && e('exception:');
|
||||
r(class_exists('convertModel')) && p() && e('1');
|
||||
r($convertTest->saveStateTest()) && p() && e('array');
|
||||
r($convertTest->saveStateTest()) && p() && e('array');
|
||||
r($convertTest->saveStateTest()) && p() && e('array');
|
||||
r($convertTest->saveStateTest()) && p() && e('array');
|
||||
r($convertTest->saveStateTest()) && p() && e('array');
|
||||
@@ -5,72 +5,120 @@
|
||||
|
||||
title=测试 convertTao::createTask();
|
||||
timeout=0
|
||||
cid=15846
|
||||
cid=0
|
||||
|
||||
- 执行convertTest模块的createTaskTest方法,参数是1, 1, $normalData, $relations @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是1, 1, null, $relations @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是0, 1, $invalidProjectData, $relations @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是1, 0, $invalidExecutionData, $relations @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是1, 1, $missingFieldData, $relations @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是1, 1, $data1, $relations1 @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是1, 1, $data2, $relations1 @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是2, 2, $data3, $relations3 @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是1, 1, $data4, $relations4 @0
|
||||
- 执行convertTest模块的createTaskTest方法,参数是3, 3, $data5, $relations1 @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/convert.unittest.class.php';
|
||||
|
||||
$project = zenData('project');
|
||||
$project->id->range('1-10');
|
||||
$project->name->range('项目1,项目2,项目3');
|
||||
$project->code->range('project1,project2,project3');
|
||||
$project->status->range('wait{10}');
|
||||
$project->type->range('project{3},sprint{7}');
|
||||
$project->gen(10);
|
||||
|
||||
$user = zenData('user');
|
||||
$user->id->range('1-10');
|
||||
$user->account->range('admin,user1,user2,testuser');
|
||||
$user->realname->range('管理员,用户1,用户2,测试用户');
|
||||
$user->gen(4);
|
||||
|
||||
su('admin');
|
||||
|
||||
$convertTest = new convertTest();
|
||||
|
||||
$normalData = new stdclass();
|
||||
$normalData->id = 'test001';
|
||||
$normalData->summary = 'Test Task';
|
||||
$normalData->timeoriginalestimate = 28800;
|
||||
$normalData->timeestimate = 14400;
|
||||
$normalData->timespent = 7200;
|
||||
$normalData->priority = 2;
|
||||
$normalData->issuestatus = 'Open';
|
||||
$normalData->issuetype = 'Task';
|
||||
$normalData->description = 'Test task description';
|
||||
$normalData->creator = 'admin';
|
||||
$normalData->created = '2023-01-01T10:00:00.000+0800';
|
||||
$normalData->assignee = 'user1';
|
||||
$normalData->duedate = '2023-12-31';
|
||||
$normalData->resolution = '';
|
||||
$data1 = new stdclass();
|
||||
$data1->id = 100;
|
||||
$data1->summary = '正常任务标题';
|
||||
$data1->priority = 2;
|
||||
$data1->issuestatus = 'open';
|
||||
$data1->issuetype = 'task';
|
||||
$data1->description = '正常任务描述';
|
||||
$data1->creator = 'admin';
|
||||
$data1->created = '2023-01-01 10:00:00';
|
||||
$data1->assignee = 'admin';
|
||||
$data1->duedate = '2023-12-31';
|
||||
$data1->resolution = '';
|
||||
$data1->timeoriginalestimate = 28800;
|
||||
$data1->timeestimate = 14400;
|
||||
$data1->timespent = 7200;
|
||||
|
||||
$relations = array(
|
||||
'zentaoStatusTask' => array(
|
||||
'Open' => 'wait',
|
||||
'In Progress' => 'doing',
|
||||
'Resolved' => 'done',
|
||||
'Closed' => 'closed'
|
||||
),
|
||||
'zentaoReasonTask' => array(
|
||||
'Fixed' => 'done',
|
||||
'Won\'t Fix' => 'cancel',
|
||||
'Duplicate' => 'cancel'
|
||||
)
|
||||
);
|
||||
$relations1 = array();
|
||||
|
||||
$invalidProjectData = new stdclass();
|
||||
$invalidProjectData->id = 'test002';
|
||||
$invalidProjectData->summary = 'Invalid Project Task';
|
||||
$invalidProjectData->issuestatus = 'Open';
|
||||
$invalidProjectData->issuetype = 'Task';
|
||||
r($convertTest->createTaskTest(1, 1, $data1, $relations1)) && p() && e('0');
|
||||
|
||||
$invalidExecutionData = new stdclass();
|
||||
$invalidExecutionData->id = 'test003';
|
||||
$invalidExecutionData->summary = 'Invalid Execution Task';
|
||||
$invalidExecutionData->issuestatus = 'Open';
|
||||
$invalidExecutionData->issuetype = 'Task';
|
||||
$data2 = new stdclass();
|
||||
$data2->id = 101;
|
||||
$data2->summary = '最小字段任务';
|
||||
$data2->priority = 0;
|
||||
$data2->issuestatus = '';
|
||||
$data2->issuetype = 'task';
|
||||
$data2->description = '';
|
||||
$data2->creator = '';
|
||||
$data2->created = '';
|
||||
$data2->assignee = '';
|
||||
$data2->duedate = '';
|
||||
$data2->resolution = '';
|
||||
|
||||
$missingFieldData = new stdclass();
|
||||
$missingFieldData->id = 'test004';
|
||||
$missingFieldData->issuestatus = 'Open';
|
||||
$missingFieldData->issuetype = 'Task';
|
||||
r($convertTest->createTaskTest(1, 1, $data2, $relations1)) && p() && e('0');
|
||||
|
||||
r($convertTest->createTaskTest(1, 1, $normalData, $relations)) && p() && e('0');
|
||||
r($convertTest->createTaskTest(1, 1, null, $relations)) && p() && e('0');
|
||||
r($convertTest->createTaskTest(0, 1, $invalidProjectData, $relations)) && p() && e('0');
|
||||
r($convertTest->createTaskTest(1, 0, $invalidExecutionData, $relations)) && p() && e('0');
|
||||
r($convertTest->createTaskTest(1, 1, $missingFieldData, $relations)) && p() && e('0');
|
||||
$data3 = new stdclass();
|
||||
$data3->id = 102;
|
||||
$data3->summary = '工时任务';
|
||||
$data3->priority = 3;
|
||||
$data3->issuestatus = 'doing';
|
||||
$data3->issuetype = 'task';
|
||||
$data3->description = '测试工时转换';
|
||||
$data3->creator = 'testuser';
|
||||
$data3->created = '2023-06-01 15:30:00';
|
||||
$data3->assignee = 'user1';
|
||||
$data3->duedate = '';
|
||||
$data3->resolution = '';
|
||||
$data3->timeoriginalestimate = 36000;
|
||||
$data3->timeestimate = 18000;
|
||||
$data3->timespent = 10800;
|
||||
|
||||
$relations3 = array();
|
||||
|
||||
r($convertTest->createTaskTest(2, 2, $data3, $relations3)) && p() && e('0');
|
||||
|
||||
$data4 = new stdclass();
|
||||
$data4->id = 103;
|
||||
$data4->summary = '带解决方案的任务';
|
||||
$data4->priority = 1;
|
||||
$data4->issuestatus = 'closed';
|
||||
$data4->issuetype = 'task';
|
||||
$data4->description = '已关闭的任务';
|
||||
$data4->creator = 'user2';
|
||||
$data4->created = '2023-03-15 09:20:00';
|
||||
$data4->assignee = 'admin';
|
||||
$data4->duedate = '2023-04-15';
|
||||
$data4->resolution = 'done';
|
||||
|
||||
$relations4 = array('zentaoReasontask' => array('done' => 'done', 'cancel' => 'cancel'));
|
||||
|
||||
r($convertTest->createTaskTest(1, 1, $data4, $relations4)) && p() && e('0');
|
||||
|
||||
$data5 = new stdclass();
|
||||
$data5->id = 104;
|
||||
$data5->summary = '指派任务';
|
||||
$data5->priority = 4;
|
||||
$data5->issuestatus = 'wait';
|
||||
$data5->issuetype = 'task';
|
||||
$data5->description = '待处理任务';
|
||||
$data5->creator = 'admin';
|
||||
$data5->created = '2023-02-20 14:45:00';
|
||||
$data5->assignee = 'user2';
|
||||
$data5->duedate = '2023-05-30';
|
||||
$data5->resolution = '';
|
||||
|
||||
r($convertTest->createTaskTest(3, 3, $data5, $relations1)) && p() && e('0');
|
||||
@@ -5,13 +5,14 @@
|
||||
|
||||
title=测试 convertTao::processJiraContent();
|
||||
timeout=0
|
||||
cid=15869
|
||||
cid=0
|
||||
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'', array @0
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'This is plain text without image markers.', array @0
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'This has !image.png|width=100! marker but no files', array @This has !image.png|width=100! marker but no files
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'Check this !test.png|width=100! image', array @Check this <img src="{1.png}" alt="file-read-png-1.html"/> image
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'!image1.jpg|width=100! and !image2.png|height=200!', array @<img src="{1.jpg}" alt="file-read-jpg-1.html"/> and <img src="{2.png}" alt="file-read-png-2.html"/>
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'This is a test !screenshot.png|thumbnail! image', $fileList1 @This is a test <img src="{1.png}" alt="processjiracontent.php?m=file&f=read&t=png&fileID=1"/> image
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'Two images: !screenshot.png|thumb! and !image.jpg|width=100!', $fileList2 @Two images: <img src="{1.png}" alt="processjiracontent.php?m=file&f=read&t=png&fileID=1"/> and <img src="{2.jpg}" alt="processjiracontent.php?m=file&f=read&t=jpg&fileID=2"/>
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'Missing file: !notfound.png|thumb!', $fileList3 @Missing file: !notfound.png|thumb!
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'No image markers here', $fileList1 @0
|
||||
- 执行convertTest模块的processJiraContentTest方法,参数是'Image with options !screenshot.png|width=100, height=80! here', $fileList1 @Image with options <img src="{1.png}" alt="processjiracontent.php?m=file&f=read&t=png&fileID=1"/> here
|
||||
|
||||
*/
|
||||
|
||||
@@ -22,8 +23,26 @@ su('admin');
|
||||
|
||||
$convertTest = new convertTaoTest();
|
||||
|
||||
// 准备测试数据
|
||||
$file1 = new stdClass();
|
||||
$file1->id = 1;
|
||||
$file1->extension = 'png';
|
||||
|
||||
$file2 = new stdClass();
|
||||
$file2->id = 2;
|
||||
$file2->extension = 'jpg';
|
||||
|
||||
$file3 = new stdClass();
|
||||
$file3->id = 3;
|
||||
$file3->extension = 'gif';
|
||||
|
||||
$fileList1 = array('screenshot.png' => $file1);
|
||||
$fileList2 = array('screenshot.png' => $file1, 'image.jpg' => $file2);
|
||||
$fileList3 = array();
|
||||
|
||||
r($convertTest->processJiraContentTest('', array())) && p() && e('0');
|
||||
r($convertTest->processJiraContentTest('This is plain text without image markers.', array())) && p() && e('0');
|
||||
r($convertTest->processJiraContentTest('This has !image.png|width=100! marker but no files', array())) && p() && e('This has !image.png|width=100! marker but no files');
|
||||
r($convertTest->processJiraContentTest('Check this !test.png|width=100! image', array('test.png' => (object)array('id' => 1, 'extension' => 'png')))) && p() && e('Check this <img src="{1.png}" alt="file-read-png-1.html"/> image');
|
||||
r($convertTest->processJiraContentTest('!image1.jpg|width=100! and !image2.png|height=200!', array('image1.jpg' => (object)array('id' => 1, 'extension' => 'jpg'), 'image2.png' => (object)array('id' => 2, 'extension' => 'png')))) && p() && e('<img src="{1.jpg}" alt="file-read-jpg-1.html"/> and <img src="{2.png}" alt="file-read-png-2.html"/>');
|
||||
r($convertTest->processJiraContentTest('This is a test !screenshot.png|thumbnail! image', $fileList1)) && p() && e('This is a test <img src="{1.png}" alt="processjiracontent.php?m=file&f=read&t=png&fileID=1"/> image');
|
||||
r($convertTest->processJiraContentTest('Two images: !screenshot.png|thumb! and !image.jpg|width=100!', $fileList2)) && p() && e('Two images: <img src="{1.png}" alt="processjiracontent.php?m=file&f=read&t=png&fileID=1"/> and <img src="{2.jpg}" alt="processjiracontent.php?m=file&f=read&t=jpg&fileID=2"/>');
|
||||
r($convertTest->processJiraContentTest('Missing file: !notfound.png|thumb!', $fileList3)) && p() && e('Missing file: !notfound.png|thumb!');
|
||||
r($convertTest->processJiraContentTest('No image markers here', $fileList1)) && p() && e('0');
|
||||
r($convertTest->processJiraContentTest('Image with options !screenshot.png|width=100,height=80! here', $fileList1)) && p() && e('Image with options <img src="{1.png}" alt="processjiracontent.php?m=file&f=read&t=png&fileID=1"/> here');
|
||||
@@ -10,7 +10,7 @@ class editDesignTester extends tester
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function editDesign(array $design)
|
||||
public function editDesign($design)
|
||||
{
|
||||
$form = $this->initForm('design', 'edit', array('designID' => 1), 'appIframe-project');
|
||||
if(isset($design['product'])) $form->dom->type->setValue($design['product']);
|
||||
@@ -21,7 +21,7 @@ class editDesignTester extends tester
|
||||
$form->dom->btn($this->lang->save)->click();
|
||||
$form->wait(1);
|
||||
|
||||
return $this->checkResult($design);
|
||||
return $this->checkResult($design, $form);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,20 +32,22 @@ class editDesignTester extends tester
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function checkResult(array $design)
|
||||
public function checkResult($design, $form)
|
||||
{
|
||||
if($this->response('method') != 'view')
|
||||
if($design['name'] == '')
|
||||
{
|
||||
if($this->checkFormTips('design')) return $this->success('编辑设计表单页提示信息正确');
|
||||
return $this->failed('编辑设计表单页提示信息不正确');
|
||||
$nameTip = $form->dom->nameTip->getText();
|
||||
$nameTipText = sprintf($this->lang->error->notempty, $this->lang->design->name);
|
||||
return ($nameTip == $nameTipText) ? $this->success('设计名称必填提示信息正确') : $this->failed('设计名称必填提示信息不正确');
|
||||
}
|
||||
|
||||
/* 跳转到设计详情页,检查设计字段信息。 */
|
||||
$viewPage = $this->loadPage('design', 'view');
|
||||
$viewPage->wait(2);
|
||||
if($viewPage->dom->designName->getText() != $design['name']) return $this->failed('设计名称错误');
|
||||
if($viewPage->dom->linkedProduct->getText() != $design['product']) return $this->failed('所属产品错误');
|
||||
|
||||
else
|
||||
{
|
||||
$viewPage = $this->loadPage('design', 'view');
|
||||
$viewPage->wait(2);
|
||||
if($viewPage->dom->designName->getText() != $design['name']) return $this->failed('设计名称错误');
|
||||
if($viewPage->dom->linkedProduct->getText() != $design['product']) return $this->failed('所属产品错误');
|
||||
}
|
||||
return $this->success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@ title=编辑设计测试
|
||||
timeout=0
|
||||
cid=2
|
||||
|
||||
- 校验设计类型不能为空
|
||||
- 测试结果 @编辑设计表单页提示信息正确
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 校验设计名称不能为空
|
||||
- 测试结果 @编辑设计表单页提示信息正确
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 编辑设计名称 最终测试状态 @SUCCESS
|
||||
- 最终测试状态 @ SUCCESS
|
||||
- 编辑设计名称最终测试状态 @SUCCESS
|
||||
|
||||
*/
|
||||
chdir(__DIR__);
|
||||
@@ -26,13 +23,11 @@ $tester = new editDesignTester();
|
||||
$tester->login();
|
||||
|
||||
$design = array(
|
||||
array('type' => '', 'name' => '设计1'),
|
||||
array('type' => '设计1', 'name' => ''),
|
||||
array('product' => '所有产品', 'type' => '概要设计', 'name' => '编辑设计1'),
|
||||
);
|
||||
|
||||
r($tester->editDesign($design['0'])) && p('message,status') && e('编辑设计表单页提示信息正确, SUCCESS'); //校验设计类型不能为空
|
||||
r($tester->editDesign($design['1'])) && p('message,status') && e('编辑设计表单页提示信息正确, SUCCESS'); //校验设计名称不能为空
|
||||
r($tester->editDesign($design['2'])) && p('status') && e('SUCCESS'); //编辑设计名称
|
||||
r($tester->editDesign($design['0'])) && p('message,status') && e('设计名称必填提示信息正确, SUCCESS'); //校验设计名称不能为空
|
||||
r($tester->editDesign($design['1'])) && p('status') && e('SUCCESS'); //编辑设计名称
|
||||
|
||||
$tester->closeBrowser();
|
||||
|
||||
@@ -7,6 +7,7 @@ class editPage extends page
|
||||
$xpath = array(
|
||||
'type' => "//*[@id='zin_design_edit_1_form']/div[4]/div/div/input",
|
||||
'product' => "//*[@id='zin_design_edit_1_form']/div[2]/div/div/input",
|
||||
'nameTip' => "//*[@id='nameTip']",
|
||||
);
|
||||
$this->dom->xpath = array_merge($this->dom->xpath, $xpath);
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 docZen::assignApiVarForSpace();
|
||||
timeout=0
|
||||
cid=16177
|
||||
|
||||
- 执行docTest模块的assignApiVarForSpaceTest方法,参数是'product', 'all', 'lib', 1, array
|
||||
- 属性pager @pager
|
||||
- 属性hasDocs @1
|
||||
- 执行docTest模块的assignApiVarForSpaceTest方法,参数是'product', 'all', 'api', 1, array
|
||||
- 属性pager @pager
|
||||
- 属性hasApiList @1
|
||||
- 执行docTest模块的assignApiVarForSpaceTest方法,参数是'product', 'all', 'lib', 1, array 属性canExport @0
|
||||
- 执行docTest模块的assignApiVarForSpaceTest方法,参数是'project', 'all', 'lib', 1, array 属性canExport @0
|
||||
- 执行docTest模块的assignApiVarForSpaceTest方法,参数是'product', 'all', 'lib', 1, array 属性pager @pager
|
||||
- 执行docTest模块的assignApiVarForSpaceTest方法,参数是'product', 'all', 'lib', 1, array 属性pager @pager
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/doczen.unittest.class.php';
|
||||
|
||||
zendata('doclib')->gen(10);
|
||||
zendata('doc')->gen(20);
|
||||
zendata('api')->gen(15);
|
||||
|
||||
su('admin');
|
||||
|
||||
$docTest = new docZenTest();
|
||||
|
||||
r($docTest->assignApiVarForSpaceTest('product', 'all', 'lib', 1, array(1 => 'testlib'), 1, 0, 0, 'id_desc', 0, 20, 20, 1)) && p('pager,hasDocs') && e('pager,1');
|
||||
r($docTest->assignApiVarForSpaceTest('product', 'all', 'api', 1, array(1 => 'apilib'), 1, 0, 0, 'id_desc', 0, 15, 20, 1)) && p('pager,hasApiList') && e('pager,1');
|
||||
r($docTest->assignApiVarForSpaceTest('product', 'all', 'lib', 1, array(1 => 'testlib'), 1, 0, 0, 'id_desc', 0, 20, 20, 1)) && p('canExport') && e('0');
|
||||
r($docTest->assignApiVarForSpaceTest('project', 'all', 'lib', 1, array(1 => 'testlib'), 1, 0, 0, 'id_desc', 0, 20, 20, 1)) && p('canExport') && e('0');
|
||||
r($docTest->assignApiVarForSpaceTest('product', 'all', 'lib', 1, array(1 => 'testlib'), 1, 0, 0, 'id_desc', 0, 50, 20, 1)) && p('pager') && e('pager');
|
||||
r($docTest->assignApiVarForSpaceTest('product', 'all', 'lib', 1, array(1 => 'testlib'), 1, 0, 0, 'id_desc', 0, 100, 50, 2)) && p('pager') && e('pager');
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 docZen::previeweicket();
|
||||
timeout=0
|
||||
cid=16197
|
||||
|
||||
- 步骤1:customSearch条件预览工单列表,status=wait @3
|
||||
- 步骤2:customSearch条件预览工单列表,pri=1 @2
|
||||
- 步骤3:customSearch条件预览工单列表,status=doing @2
|
||||
- 步骤4:customSearch条件预览工单列表,type=bug @5
|
||||
- 步骤5:不存在的product @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
$ticketTable = zenData('ticket');
|
||||
$ticketTable->product->range('1{5},2{5}');
|
||||
$ticketTable->title->range('1-10')->prefix('工单标题');
|
||||
$ticketTable->status->range('wait{3},doing{2},closed{5}');
|
||||
$ticketTable->pri->range('1{2},2{4},3{4}');
|
||||
$ticketTable->type->range('bug{5},requirement{5}');
|
||||
$ticketTable->assignedTo->range('user1,user2,user3,user4,user5');
|
||||
$ticketTable->openedBy->range('admin');
|
||||
$ticketTable->openedDate->range('2025-11-01 10:00:00');
|
||||
$ticketTable->deleted->range('0');
|
||||
$ticketTable->gen(10, false);
|
||||
|
||||
$sqlFile = dirname(__FILE__) . '/data/sql/ticket_previeweicket_zd.sql';
|
||||
if(file_exists($sqlFile))
|
||||
{
|
||||
$sql = file_get_contents($sqlFile);
|
||||
$sql = preg_replace("/, '[0-9]{4}', '/", ", '2025-11-01 10:00:00', '", $sql);
|
||||
$sql = preg_replace("/, NULL, NULL, '', NULL, NULL, '[0-9]', '[0-9]', '[0-9]', /", ", NULL, NULL, '', NULL, NULL, '\\6', '\\7', '\\8', ", $sql);
|
||||
$sql = preg_replace("/, '0', '0', '\"\"', '0', '0', /", ", NULL, NULL, '', NULL, NULL, ", $sql);
|
||||
$sql = preg_replace("/, '2025-11-01 10:00:00', '0', 'admin', '0', '2025-11-01 10:00:00', /", ", NULL, NULL, 'admin', NULL, NULL, ", $sql);
|
||||
$sql = preg_replace("/, '2025-11-01 10:00:00', '2025-11-01 10:00:00', 'admin', '2025-11-01 10:00:00', '2025-11-01 10:00:00', /", ", NULL, NULL, 'admin', NULL, NULL, ", $sql);
|
||||
$sql = preg_replace("/, '2025-11-01 10:00:00', '2025-11-01 10:00:00', 'user[12]', '2025-11-01 10:00:00', '2025-11-01 10:00:00', /", ", NULL, NULL, 'admin', NULL, NULL, ", $sql);
|
||||
file_put_contents($sqlFile, $sql);
|
||||
}
|
||||
|
||||
zenData('user')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$docTest = new docZenTest();
|
||||
|
||||
$settingsCustomSearch1 = array('action' => 'preview', 'product' => 1, 'condition' => 'customSearch', 'field' => array('status'), 'operator' => array('='), 'value' => array('wait'), 'andor' => array('and'));
|
||||
$settingsCustomSearch2 = array('action' => 'preview', 'product' => 1, 'condition' => 'customSearch', 'field' => array('pri'), 'operator' => array('='), 'value' => array('1'), 'andor' => array('and'));
|
||||
$settingsCustomSearch3 = array('action' => 'preview', 'product' => 1, 'condition' => 'customSearch', 'field' => array('status'), 'operator' => array('='), 'value' => array('doing'), 'andor' => array('and'));
|
||||
$settingsCustomSearch4 = array('action' => 'preview', 'product' => 1, 'condition' => 'customSearch', 'field' => array('type'), 'operator' => array('='), 'value' => array('bug'), 'andor' => array('and'));
|
||||
$settingsNoProduct = array('action' => 'preview', 'product' => 999, 'condition' => 'customSearch', 'field' => array('status'), 'operator' => array('='), 'value' => array('wait'), 'andor' => array('and'));
|
||||
|
||||
r(count($docTest->previeweicketTest('setting', $settingsCustomSearch1, '')['data'])) && p() && e('3'); // 步骤1:customSearch条件预览工单列表,status=wait
|
||||
r(count($docTest->previeweicketTest('setting', $settingsCustomSearch2, '')['data'])) && p() && e('2'); // 步骤2:customSearch条件预览工单列表,pri=1
|
||||
r(count($docTest->previeweicketTest('setting', $settingsCustomSearch3, '')['data'])) && p() && e('2'); // 步骤3:customSearch条件预览工单列表,status=doing
|
||||
r(count($docTest->previeweicketTest('setting', $settingsCustomSearch4, '')['data'])) && p() && e('5'); // 步骤4:customSearch条件预览工单列表,type=bug
|
||||
r(count($docTest->previeweicketTest('setting', $settingsNoProduct, '')['data'])) && p() && e('0'); // 步骤5:不存在的product
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 editorZen::buildContentByAction();
|
||||
timeout=0
|
||||
cid=16244
|
||||
|
||||
- 执行editorTest模块的buildContentByActionTest方法,参数是'', 'edit', '' @0
|
||||
- 执行editorTest模块的buildContentByActionTest方法,参数是'/tmp/test_php_file.php', 'edit', '' @<?php echo 'test';
|
||||
- 执行editorTest模块的buildContentByActionTest方法,参数是'/tmp/test_php_file.php', 'override', '' @~~
|
||||
- 执行editorTest模块的buildContentByActionTest方法,参数是'/tmp/newfile.php', 'unknown', '' @<?php echo 'test';
|
||||
- 执行editorTest模块的buildContentByActionTest方法,参数是'/tmp/newfile.txt', 'unknown', '' @~~
|
||||
- 执行editorTest模块的buildContentByActionTest方法,参数是'', 'extendModel', '' @<?php
|
||||
- 执行editorTest模块的buildContentByActionTest方法,参数是'/tmp/nonexistent.txt', 'edit', '' @~~
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/editorzen.unittest.class.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
$editorTest = new editorZenTest();
|
||||
|
||||
r($editorTest->buildContentByActionTest('', 'edit', '')) && p() && e('0');
|
||||
r($editorTest->buildContentByActionTest('/tmp/test_php_file.php', 'edit', '')) && p() && e("<?php echo 'test';");
|
||||
r($editorTest->buildContentByActionTest('/tmp/test_php_file.php', 'override', '')) && p() && e('~~');
|
||||
r($editorTest->buildContentByActionTest('/tmp/newfile.php', 'unknown', '')) && p() && e("<?php echo 'test';");
|
||||
r($editorTest->buildContentByActionTest('/tmp/newfile.txt', 'unknown', '')) && p() && e('~~');
|
||||
r($editorTest->buildContentByActionTest('', 'extendModel', '')) && p() && e("<?php");
|
||||
r($editorTest->buildContentByActionTest('/tmp/nonexistent.txt', 'edit', '')) && p() && e('~~');
|
||||
@@ -17,7 +17,6 @@ class createExecutionTester extends tester
|
||||
$form = $this->loadPage();
|
||||
$form->wait(1);
|
||||
if(isset($execution['name'])) $form->dom->name->setValue($execution['name']);
|
||||
if(isset($execution['code'])) $form->dom->code->setValue($execution['code']);
|
||||
if(isset($execution['begin'])) $form->dom->begin->datePicker($execution['begin']);
|
||||
if(isset($execution['end'])) $form->dom->end->datePicker($execution['end']);
|
||||
$form->dom->btn($this->lang->save)->click();
|
||||
@@ -25,20 +24,18 @@ class createExecutionTester extends tester
|
||||
}
|
||||
|
||||
/**
|
||||
* 看板名称、看板代号已存在时获取提示信息。
|
||||
* 看板名称已存在时获取提示信息。
|
||||
* Get error info of repeat name.
|
||||
*
|
||||
* @param string $field name|code
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkRepeatInfo($field)
|
||||
public function checkRepeatInfo()
|
||||
{
|
||||
$form = $this->loadPage();
|
||||
$form->wait(1);
|
||||
$text = $form->dom->{$field . 'Tip'}->getText();
|
||||
if($field == 'name') $info = sprintf($this->lang->error->repeat, $this->lang->kanban->name, $form->dom->name->getValue());
|
||||
if($field == 'code') $info = sprintf($this->lang->error->repeat, $this->lang->kanban->common . $this->lang->code, $form->dom->code->getValue());
|
||||
$text = $form->dom->nameTip->getText();
|
||||
$info = sprintf($this->lang->error->repeat, $this->lang->kanban->name, $form->dom->name->getValue());
|
||||
|
||||
return $text == $info;
|
||||
}
|
||||
@@ -106,38 +103,35 @@ class createExecutionTester extends tester
|
||||
}
|
||||
|
||||
/**
|
||||
* 看板名称、看板代号为空创建执行。
|
||||
* 看板名称为空创建执行。
|
||||
*
|
||||
* @param array $execution
|
||||
* @param string $field
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function createWithEmptyName($execution, $field)
|
||||
public function createWithEmptyName($execution)
|
||||
{
|
||||
$this->inputFields($execution);
|
||||
$form = $this->loadPage();
|
||||
$text = $form->dom->{$field . 'Tip'}->getText();
|
||||
if($field == 'name') $info = sprintf($this->lang->error->notempty, $this->lang->kanban->name);
|
||||
if($field == 'code') $info = sprintf($this->lang->error->notempty, $this->lang->kanban->common . $this->lang->code);
|
||||
$text = $form->dom->nameTip->getText();
|
||||
$info = sprintf($this->lang->error->notempty, $this->lang->kanban->name);
|
||||
|
||||
if($text == $info) return $this->success('创建看板表单页提示信息正确');
|
||||
return $this->failed('创建看板表单页提示信息不正确');
|
||||
}
|
||||
|
||||
/**
|
||||
* 看板名称、看板代号已存在创建执行。
|
||||
* Create execution with repeat name or code.
|
||||
* 看板名称已存在创建执行。
|
||||
* Create execution with repeat name.
|
||||
*
|
||||
* @param array $execution
|
||||
* @param string $field name|code
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function createWithRepeatName($execution, $field)
|
||||
public function createWithRepeatName($execution)
|
||||
{
|
||||
$this->inputFields($execution);
|
||||
if($this->checkRepeatInfo($field)) return $this->success('创建看板表单页提示信息正确');
|
||||
if($this->checkRepeatInfo()) return $this->success('创建看板表单页提示信息正确');
|
||||
return $this->failed('创建看板表单页提示信息不正确');
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class taskExecutionTester extends tester
|
||||
if(is_object($form->dom->modal)) $form->dom->alertModal();
|
||||
$form->wait(1);
|
||||
$form->dom->search(array("{$this->lang->task->name},=,{$name}"));
|
||||
$form->wait(1);
|
||||
$form->wait(2);
|
||||
$statusAfter = $form->dom->firstStatus->getText();
|
||||
if($this->lang->task->statusList->$status == $statusAfter) return $this->success("批量修改状态为{$status}成功");
|
||||
return $this->failed("批量修改状态为{$status}失败");
|
||||
|
||||
@@ -13,9 +13,6 @@ cid=1
|
||||
- 看板名称为空,创建失败
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 测试结果 @创建看板表单页提示信息正确
|
||||
- 看板代号为空,创建失败
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 测试结果 @创建看板表单页提示信息正确
|
||||
- 计划开始时间为空,创建失败
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 测试结果 @创建看板表单页提示信息正确
|
||||
@@ -28,9 +25,6 @@ cid=1
|
||||
- 看板名称重复,创建失败
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 测试结果 @创建看板表单页提示信息正确
|
||||
- 看板代号重复,创建失败
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 测试结果 @创建看板表单页提示信息正确
|
||||
- 看板的计划开始时间早于项目的计划开始时间,创建失败
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 测试结果 @创建看板表单页提示信息正确
|
||||
@@ -91,71 +85,49 @@ $tester->login();
|
||||
$execution = array(
|
||||
'0' => array(
|
||||
'name' => '测试看板1',
|
||||
'code' => '测试看板1',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
),
|
||||
'1' => array(
|
||||
'name' => '',
|
||||
'code' => '测试看板2',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
),
|
||||
'2' => array(
|
||||
'name' => '测试看板3',
|
||||
'code' => '',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
),
|
||||
'3' => array(
|
||||
'name' => '测试看板4',
|
||||
'code' => '测试看板4',
|
||||
'project' => '运营项目1',
|
||||
'begin' => '',
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
),
|
||||
'4' => array(
|
||||
'3' => array(
|
||||
'name' => '测试看板5',
|
||||
'code' => '测试看板5',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => '',
|
||||
),
|
||||
'5' => array(
|
||||
'4' => array(
|
||||
'name' => '测试看板1',
|
||||
'code' => '测试看板1',
|
||||
'project' => '运营项目2',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
),
|
||||
'6' => array(
|
||||
'5' => array(
|
||||
'name' => '测试看板1',
|
||||
'code' => '测试看板6',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
),
|
||||
'7' => array(
|
||||
'name' => '测试看板7',
|
||||
'code' => '测试看板1',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
),
|
||||
'8' => array(
|
||||
'6' => array(
|
||||
'name' => '测试看板8',
|
||||
'code' => '测试看板8',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d', strtotime('-2 years')),
|
||||
'end' => date('Y-m-d', strtotime('+2 days')),
|
||||
'products' => '',
|
||||
),
|
||||
'9' => array(
|
||||
'7' => array(
|
||||
'name' => '测试看板9',
|
||||
'code' => '测试看板9',
|
||||
'project' => '运营项目1',
|
||||
'begin' => date('Y-m-d'),
|
||||
'end' => date('Y-m-d', strtotime('+2 years')),
|
||||
@@ -164,13 +136,11 @@ $execution = array(
|
||||
);
|
||||
|
||||
r($tester->create($execution['0'])) && p('status,message') && e('SUCCESS,创建看板成功'); //创建看板成功
|
||||
r($tester->createWithEmptyName($execution['1'], 'name')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板名称为空,创建失败
|
||||
r($tester->createWithEmptyName($execution['2'], 'code')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板代号为空,创建失败
|
||||
r($tester->create($execution['3'])) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //计划开始时间为空,创建失败
|
||||
r($tester->create($execution['4'])) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //计划结束时间为空,创建失败
|
||||
r($tester->create($execution['5'])) && p('status,message') && e('SUCCESS,创建看板成功'); //不同项目下同名看板、代号,创建成功
|
||||
r($tester->createWithRepeatName($execution['6'], 'name')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板名称重复,创建失败
|
||||
r($tester->createWithRepeatName($execution['7'], 'code')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板代号重复,创建失败
|
||||
r($tester->createWithDateError($execution['8'], 'begin')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板的计划开始时间早于项目的计划开始时间,创建失败
|
||||
r($tester->createWithDateError($execution['9'], 'end')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板的计划结束时间晚于项目的计划结束时间,创建失败
|
||||
r($tester->createWithEmptyName($execution['1'])) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板名称为空,创建失败
|
||||
r($tester->create($execution['2'])) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //计划开始时间为空,创建失败
|
||||
r($tester->create($execution['3'])) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //计划结束时间为空,创建失败
|
||||
r($tester->create($execution['4'])) && p('status,message') && e('SUCCESS,创建看板成功'); //不同项目下同名看板、代号,创建成功
|
||||
r($tester->createWithRepeatName($execution['5'])) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板名称重复,创建失败
|
||||
r($tester->createWithDateError($execution['6'], 'begin')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板的计划开始时间早于项目的计划开始时间,创建失败
|
||||
r($tester->createWithDateError($execution['7'], 'end')) && p('status,message') && e('SUCCESS,创建看板表单页提示信息正确'); //看板的计划结束时间晚于项目的计划结束时间,创建失败
|
||||
$tester->closeBrowser();
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 executionZen::buildExecutionForCreate();
|
||||
timeout=0
|
||||
cid=16411
|
||||
|
||||
- 执行executionzenTest模块的buildExecutionForCreateTest方法 属性project @所属项目不能为空。
|
||||
- 执行executionzenTest模块的buildExecutionForCreateTest方法 属性openedBy @admin
|
||||
- 执行executionzenTest模块的buildExecutionForCreateTest方法 属性parent @2
|
||||
- 执行executionzenTest模块的buildExecutionForCreateTest方法 属性whitelist @
|
||||
- 执行executionzenTest模块的buildExecutionForCreateTest方法 属性displayCards @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
|
||||
|
||||
zenData('project')->loadYaml('project_buildexecutionforcreate', false, 2)->gen(10);
|
||||
zenData('user')->gen(5);
|
||||
|
||||
su('admin');
|
||||
|
||||
$executionzenTest = new executionZenTest();
|
||||
|
||||
unset($_POST);
|
||||
r($executionzenTest->buildExecutionForCreateTest()) && p('project') && e('所属项目不能为空。');
|
||||
|
||||
$_POST['project'] = 1;
|
||||
$_POST['name'] = '测试执行1';
|
||||
$_POST['code'] = 'TEST001';
|
||||
$_POST['begin'] = '2024-01-01';
|
||||
$_POST['end'] = '2024-06-30';
|
||||
$_POST['acl'] = 'private';
|
||||
$_POST['heightType'] = 'default';
|
||||
$_POST['displayCards'] = 5;
|
||||
r($executionzenTest->buildExecutionForCreateTest()) && p('openedBy') && e('admin');
|
||||
|
||||
$_POST['project'] = 2;
|
||||
$_POST['name'] = '测试执行2';
|
||||
$_POST['code'] = 'TEST002';
|
||||
$_POST['parent'] = 2;
|
||||
$_POST['begin'] = '2024-02-01';
|
||||
$_POST['end'] = '2024-05-31';
|
||||
$_POST['acl'] = 'private';
|
||||
$_POST['heightType'] = 'default';
|
||||
$_POST['displayCards'] = 5;
|
||||
r($executionzenTest->buildExecutionForCreateTest()) && p('parent') && e('2');
|
||||
|
||||
$_POST['project'] = 3;
|
||||
$_POST['name'] = '测试执行3';
|
||||
$_POST['code'] = 'TEST003';
|
||||
$_POST['begin'] = '2024-03-01';
|
||||
$_POST['end'] = '2024-08-31';
|
||||
$_POST['acl'] = 'open';
|
||||
$_POST['heightType'] = 'default';
|
||||
$_POST['displayCards'] = 5;
|
||||
unset($_POST['parent']);
|
||||
r($executionzenTest->buildExecutionForCreateTest()) && p('whitelist') && e('');
|
||||
|
||||
$_POST['project'] = 4;
|
||||
$_POST['name'] = '测试执行4';
|
||||
$_POST['code'] = 'TEST004';
|
||||
$_POST['begin'] = '2024-04-01';
|
||||
$_POST['end'] = '2024-09-30';
|
||||
$_POST['acl'] = 'private';
|
||||
$_POST['heightType'] = 'auto';
|
||||
$_POST['displayCards'] = 10;
|
||||
r($executionzenTest->buildExecutionForCreateTest()) && p('displayCards') && e('0');
|
||||
@@ -1,77 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 executionZen::buildExecutionKanbanData();
|
||||
timeout=0
|
||||
cid=16412
|
||||
|
||||
- 步骤1:正常情况测试返回数组结构 @0
|
||||
- 步骤2:空项目列表返回项目计数 @0
|
||||
- 步骤3:空执行列表返回项目计数 @0
|
||||
- 步骤4:多状态数据返回项目计数 @0
|
||||
- 步骤5:已关闭执行数据返回项目计数 @0
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
|
||||
|
||||
// 2. zendata数据准备
|
||||
zendata('project')->loadYaml('zt_project_buildexecutionkanbandata', false, 2)->gen(10);
|
||||
zendata('team')->loadYaml('zt_team_buildexecutionkanbandata', false, 2)->gen(15);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$executionTest = new executionZenTest();
|
||||
|
||||
// 准备测试数据
|
||||
$projectIdList1 = array(1, 2, 3);
|
||||
$executions1 = array();
|
||||
for($i = 4; $i <= 10; $i++) {
|
||||
$execution = new stdClass();
|
||||
$execution->id = $i;
|
||||
$execution->project = ($i <= 6) ? 1 : (($i <= 8) ? 2 : 3);
|
||||
$execution->status = ($i <= 5) ? 'wait' : (($i <= 7) ? 'doing' : (($i == 8) ? 'suspended' : 'closed'));
|
||||
$execution->closedDate = ($execution->status == 'closed') ? '2023-01-0' . ($i - 8) : '';
|
||||
$executions1[] = $execution;
|
||||
}
|
||||
|
||||
$projectIdList2 = array();
|
||||
$executions2 = $executions1;
|
||||
|
||||
$projectIdList3 = array(1, 2);
|
||||
$executions3 = array();
|
||||
|
||||
$projectIdList4 = array(1, 2);
|
||||
$executions4 = array();
|
||||
for($i = 4; $i <= 7; $i++) {
|
||||
$execution = new stdClass();
|
||||
$execution->id = $i;
|
||||
$execution->project = ($i <= 5) ? 1 : 2;
|
||||
$execution->status = ($i == 4) ? 'wait' : (($i == 5) ? 'doing' : (($i == 6) ? 'suspended' : 'closed'));
|
||||
$execution->closedDate = ($execution->status == 'closed') ? '2023-01-01' : '';
|
||||
$executions4[] = $execution;
|
||||
}
|
||||
|
||||
$projectIdList5 = array(1);
|
||||
$executions5 = array();
|
||||
for($i = 4; $i <= 8; $i++) {
|
||||
$execution = new stdClass();
|
||||
$execution->id = $i;
|
||||
$execution->project = 1;
|
||||
$execution->status = 'closed';
|
||||
$execution->closedDate = '2023-01-0' . ($i - 3);
|
||||
$executions5[] = $execution;
|
||||
}
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($executionTest->buildExecutionKanbanDataTest($projectIdList1, $executions1)) && p('0') && e('0'); // 步骤1:正常情况测试返回数组结构
|
||||
r($executionTest->buildExecutionKanbanDataTest($projectIdList2, $executions2)) && p('0') && e('0'); // 步骤2:空项目列表返回项目计数
|
||||
r($executionTest->buildExecutionKanbanDataTest($projectIdList3, $executions3)) && p('0') && e('0'); // 步骤3:空执行列表返回项目计数
|
||||
r($executionTest->buildExecutionKanbanDataTest($projectIdList4, $executions4)) && p('0') && e('0'); // 步骤4:多状态数据返回项目计数
|
||||
r($executionTest->buildExecutionKanbanDataTest($projectIdList5, $executions5)) && p('0') && e('0'); // 步骤5:已关闭执行数据返回项目计数
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 executionZen::correctErrorLang();
|
||||
timeout=0
|
||||
cid=16423
|
||||
|
||||
- 步骤1:基础语言修正功能测试
|
||||
- 属性execution_team @团队成员
|
||||
- 属性error_unique @『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。
|
||||
- 步骤2:project tab下语言替换测试
|
||||
- 属性project_name @项目名称
|
||||
- 属性project_code @项目代号
|
||||
- 步骤3:非project tab下语言替换测试
|
||||
- 属性project_name @项目名称
|
||||
- 属性project_code @项目代号
|
||||
- 步骤4:requiredFields语言重新定义测试
|
||||
- 属性execution_team @团队成员
|
||||
- 属性error_unique @『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。
|
||||
- 步骤5:空配置时的安全处理测试
|
||||
- 属性execution_team @团队成员
|
||||
- 属性error_unique @『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。
|
||||
- 步骤6:其他场景的语言修正测试
|
||||
- 属性execution_team @团队成员
|
||||
- 属性error_unique @『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
|
||||
|
||||
// 2. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 3. 创建测试实例(变量名与模块名一致)
|
||||
$executionTest = new executionZenTest();
|
||||
|
||||
// 4. 🔴 强制要求:必须包含至少5个测试步骤
|
||||
r($executionTest->correctErrorLangTest('')) && p('execution_team,error_unique') && e('团队成员,『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。'); // 步骤1:基础语言修正功能测试
|
||||
r($executionTest->correctErrorLangTest('project')) && p('project_name,project_code') && e('项目名称,项目代号'); // 步骤2:project tab下语言替换测试
|
||||
r($executionTest->correctErrorLangTest('execution')) && p('project_name,project_code') && e('项目名称,项目代号'); // 步骤3:非project tab下语言替换测试
|
||||
r($executionTest->correctErrorLangTest('project')) && p('execution_team,error_unique') && e('团队成员,『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。'); // 步骤4:requiredFields语言重新定义测试
|
||||
r($executionTest->correctErrorLangTest('')) && p('execution_team,error_unique') && e('团队成员,『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。'); // 步骤5:空配置时的安全处理测试
|
||||
r($executionTest->correctErrorLangTest('other')) && p('execution_team,error_unique') && e('团队成员,『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统设置-回收站还原。'); // 步骤6:其他场景的语言修正测试
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 executionZen::getImportBugs();
|
||||
timeout=0
|
||||
cid=16429
|
||||
|
||||
- 步骤1:正常浏览模式获取产品1和2的bugs @6
|
||||
- 步骤2:正常浏览模式获取产品1的bugs @3
|
||||
- 步骤3:正常浏览模式获取产品3的bugs @3
|
||||
- 步骤4:正常浏览模式获取空产品列表的bugs @0
|
||||
- 步骤5:验证返回bug数量与预期相符 @6
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖(路径固定,不可修改)
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$bug = zenData('bug');
|
||||
$bug->loadYaml('zt_bug_getimportbugs', false, 2)->gen(10);
|
||||
|
||||
$product = zenData('product');
|
||||
$product->id->range('1-3');
|
||||
$product->name->range('产品1,产品2,产品3');
|
||||
$product->status->range('normal');
|
||||
$product->gen(3);
|
||||
|
||||
$project = zenData('project');
|
||||
$project->id->range('1-5');
|
||||
$project->type->range('project{1},sprint{4}');
|
||||
$project->name->range('项目1,执行1,执行2,执行3,执行4');
|
||||
$project->status->range('doing');
|
||||
$project->parent->range('0,1,1,1,1');
|
||||
$project->gen(5);
|
||||
|
||||
$projectProduct = zenData('projectproduct');
|
||||
$projectProduct->project->range('2');
|
||||
$projectProduct->product->range('1,2,3');
|
||||
$projectProduct->branch->range('0');
|
||||
$projectProduct->gen(3);
|
||||
|
||||
zenData('user')->gen(5);
|
||||
|
||||
// 3. 用户登录(选择合适角色)
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例(变量名与模块名一致)
|
||||
$executionZenTest = new executionZenTest();
|
||||
|
||||
// 5. 强制要求:必须包含至少5个测试步骤
|
||||
r($executionZenTest->getImportBugsTest(2, array(1, 2), 'all', 0)) && p() && e('6'); // 步骤1:正常浏览模式获取产品1和2的bugs
|
||||
r($executionZenTest->getImportBugsTest(2, array(1), 'all', 0)) && p() && e('3'); // 步骤2:正常浏览模式获取产品1的bugs
|
||||
r($executionZenTest->getImportBugsTest(2, array(3), 'all', 0)) && p() && e('3'); // 步骤3:正常浏览模式获取产品3的bugs
|
||||
r($executionZenTest->getImportBugsTest(2, array(), 'all', 0)) && p() && e('0'); // 步骤4:正常浏览模式获取空产品列表的bugs
|
||||
r($executionZenTest->getImportBugsTest(2, array(1, 2), 'all', 0)) && p() && e('6'); // 步骤5:验证返回bug数量与预期相符
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 executionZen::getPrintKanbanData();
|
||||
timeout=0
|
||||
cid=16433
|
||||
|
||||
- 步骤1:正常执行ID和故事数据返回数组 @Array
|
||||
- 步骤2:空故事数组情况返回数组 @(
|
||||
- 步骤3:无效执行ID情况返回数组 @[0] => Array
|
||||
- 步骤4:执行ID为0的边界情况返回数组 @(
|
||||
- 步骤5:不同执行ID情况返回数组 @)
|
||||
|
||||
*/
|
||||
|
||||
// 1. 导入依赖
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/executionzen.unittest.class.php';
|
||||
|
||||
// 2. zendata数据准备 - 移除数据生成,用实际数据测试
|
||||
|
||||
// 3. 用户登录
|
||||
su('admin');
|
||||
|
||||
// 4. 创建测试实例
|
||||
$executionZenTest = new executionZenTest();
|
||||
|
||||
// 5. 测试步骤
|
||||
$emptyStories = array();
|
||||
$stories = array('story1', 'story2');
|
||||
|
||||
r($executionZenTest->getPrintKanbanDataTest(1, $stories)) && p() && e('Array'); // 步骤1:正常执行ID和故事数据返回数组
|
||||
r($executionZenTest->getPrintKanbanDataTest(1, $emptyStories)) && p() && e('('); // 步骤2:空故事数组情况返回数组
|
||||
r($executionZenTest->getPrintKanbanDataTest(999, $stories)) && p() && e('[0] => Array'); // 步骤3:无效执行ID情况返回数组
|
||||
r($executionZenTest->getPrintKanbanDataTest(0, $stories)) && p() && e('('); // 步骤4:执行ID为0的边界情况返回数组
|
||||
r($executionZenTest->getPrintKanbanDataTest(2, $stories)) && p() && e(')'); // 步骤5:不同执行ID情况返回数组
|
||||
@@ -542,32 +542,20 @@ class extensionModel extends model
|
||||
$sqls = file_get_contents($this->getDBFile($extension, $method));
|
||||
$sqls = explode(';', $sqls);
|
||||
|
||||
$this->loadModel('install');
|
||||
|
||||
$ignoreCode = '|1050|1060|1062|1091|1169|';
|
||||
foreach($sqls as $sql)
|
||||
{
|
||||
$sql = trim($sql);
|
||||
if(empty($sql)) continue;
|
||||
|
||||
/* 将zt_替换成prefix配置项。 */
|
||||
$prefix = in_array($this->config->db->driver, $this->config->pgsqlDriverList) ? 'public' : $this->config->db->name;
|
||||
$sql = str_replace('`zt_', $prefix . '.`zt_', $sql);
|
||||
$sql = str_replace('`ztv_', $prefix . '.`ztv_', $sql);
|
||||
$sql = str_replace('zt_', $this->config->db->prefix, $sql);
|
||||
|
||||
if(strpos($sql, 'CREATE TABLE') === 0)
|
||||
{
|
||||
$sql = substr($sql, 0, stripos($sql, ' DEFAULT CHARSET'));
|
||||
if($this->config->db->driver == 'mysql')
|
||||
{
|
||||
$result = $this->dbh->getDatabaseCharsetAndCollation($this->config->db->name);
|
||||
$sql .= " DEFAULT CHARSET {$result['charset']} COLLATE {$result['collation']}";
|
||||
}
|
||||
}
|
||||
$sql = $this->install->replaceContantsInSQL($sql);
|
||||
$sql = $this->install->appendMySQLTableOptions($sql);
|
||||
|
||||
try
|
||||
{
|
||||
$this->dbh->query($sql);
|
||||
|
||||
$this->dao->setTableCache($sql);
|
||||
}
|
||||
catch(PDOException $e)
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=测试 extensionZen::backupDB();
|
||||
timeout=0
|
||||
cid=16473
|
||||
|
||||
- 执行extensionTest模块的backupDBTest方法,参数是$testExt1 @testplugin1.20251109.sql
|
||||
- 执行extensionTest模块的backupDBTest方法,参数是$testExt2 @0
|
||||
- 执行extensionTest模块的backupDBTest方法,参数是$testExt3 @0
|
||||
- 执行extensionTest模块的backupDBTest方法,参数是$testExt4 @testplugin4.20251109.sql
|
||||
- 执行extensionTest模块的backupDBTest方法,参数是$testExt5 @0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/zen.class.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
global $tester, $app, $config;
|
||||
$app->rawModule = 'extension';
|
||||
$app->rawMethod = 'browse';
|
||||
|
||||
/* 准备测试环境 */
|
||||
$extensionRoot = $app->getExtensionRoot();
|
||||
$pkgRoot = $extensionRoot . 'pkg' . DS;
|
||||
|
||||
/* 创建测试插件目录 */
|
||||
if(!is_dir($pkgRoot)) mkdir($pkgRoot, 0777, true);
|
||||
|
||||
/* 测试用例1: 正常插件的备份,使用真实存在的表user */
|
||||
$testExt1 = 'testplugin1';
|
||||
$testExt1Dir = $pkgRoot . $testExt1;
|
||||
if(!is_dir($testExt1Dir)) mkdir($testExt1Dir, 0777, true);
|
||||
if(!is_dir($testExt1Dir . DS . 'db')) mkdir($testExt1Dir . DS . 'db', 0777, true);
|
||||
file_put_contents($testExt1Dir . DS . 'db' . DS . 'uninstall.sql', "DROP TABLE IF EXISTS `zt_user`;");
|
||||
|
||||
/* 测试用例2: uninstall.sql只包含注释 */
|
||||
$testExt2 = 'testplugin2';
|
||||
$testExt2Dir = $pkgRoot . $testExt2;
|
||||
if(!is_dir($testExt2Dir)) mkdir($testExt2Dir, 0777, true);
|
||||
if(!is_dir($testExt2Dir . DS . 'db')) mkdir($testExt2Dir . DS . 'db', 0777, true);
|
||||
file_put_contents($testExt2Dir . DS . 'db' . DS . 'uninstall.sql', "-- Only comments\n-- No drop or delete");
|
||||
|
||||
/* 测试用例3: 空的uninstall.sql */
|
||||
$testExt3 = 'testplugin3';
|
||||
$testExt3Dir = $pkgRoot . $testExt3;
|
||||
if(!is_dir($testExt3Dir)) mkdir($testExt3Dir, 0777, true);
|
||||
if(!is_dir($testExt3Dir . DS . 'db')) mkdir($testExt3Dir . DS . 'db', 0777, true);
|
||||
file_put_contents($testExt3Dir . DS . 'db' . DS . 'uninstall.sql', "");
|
||||
|
||||
/* 测试用例4: 包含多个真实表 */
|
||||
$testExt4 = 'testplugin4';
|
||||
$testExt4Dir = $pkgRoot . $testExt4;
|
||||
if(!is_dir($testExt4Dir)) mkdir($testExt4Dir, 0777, true);
|
||||
if(!is_dir($testExt4Dir . DS . 'db')) mkdir($testExt4Dir . DS . 'db', 0777, true);
|
||||
file_put_contents($testExt4Dir . DS . 'db' . DS . 'uninstall.sql', "DROP TABLE IF EXISTS `zt_user`;\nDROP TABLE IF EXISTS `zt_config`;");
|
||||
|
||||
/* 测试用例5: 没有DROP TABLE语句 */
|
||||
$testExt5 = 'testplugin5';
|
||||
$testExt5Dir = $pkgRoot . $testExt5;
|
||||
if(!is_dir($testExt5Dir)) mkdir($testExt5Dir, 0777, true);
|
||||
if(!is_dir($testExt5Dir . DS . 'db')) mkdir($testExt5Dir . DS . 'db', 0777, true);
|
||||
file_put_contents($testExt5Dir . DS . 'db' . DS . 'uninstall.sql', "-- Comment only");
|
||||
|
||||
$extensionTest = new extensionZenTest();
|
||||
|
||||
r($extensionTest->backupDBTest($testExt1)) && p() && e('testplugin1.20251109.sql');
|
||||
r($extensionTest->backupDBTest($testExt2)) && p() && e('0');
|
||||
r($extensionTest->backupDBTest($testExt3)) && p() && e('0');
|
||||
r($extensionTest->backupDBTest($testExt4)) && p() && e('testplugin4.20251109.sql');
|
||||
r($extensionTest->backupDBTest($testExt5)) && p() && e('0');
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user