diff --git a/zdata/common/color/v1.yaml b/test/data/common/color/v1.yaml similarity index 100% rename from zdata/common/color/v1.yaml rename to test/data/common/color/v1.yaml diff --git a/zdata/common/date/v1.yaml b/test/data/common/date/v1.yaml similarity index 100% rename from zdata/common/date/v1.yaml rename to test/data/common/date/v1.yaml diff --git a/zdata/common/file/v1.yaml b/test/data/common/file/v1.yaml similarity index 100% rename from zdata/common/file/v1.yaml rename to test/data/common/file/v1.yaml diff --git a/zdata/common/groups/v1.yaml b/test/data/common/groups/v1.yaml similarity index 100% rename from zdata/common/groups/v1.yaml rename to test/data/common/groups/v1.yaml diff --git a/zdata/common/ip/v1.yaml b/test/data/common/ip/v1.yaml similarity index 100% rename from zdata/common/ip/v1.yaml rename to test/data/common/ip/v1.yaml diff --git a/zdata/common/phone/v1.yaml b/test/data/common/phone/v1.yaml similarity index 100% rename from zdata/common/phone/v1.yaml rename to test/data/common/phone/v1.yaml diff --git a/zdata/common/user/v1.yaml b/test/data/common/user/v1.yaml similarity index 100% rename from zdata/common/user/v1.yaml rename to test/data/common/user/v1.yaml diff --git a/zdata/common/version/v1.yaml b/test/data/common/version/v1.yaml similarity index 100% rename from zdata/common/version/v1.yaml rename to test/data/common/version/v1.yaml diff --git a/zdata/create.php b/test/data/create.php similarity index 100% rename from zdata/create.php rename to test/data/create.php diff --git a/zdata/demo/story/common/color/v1.yaml b/test/data/demo/story/common/color/v1.yaml similarity index 100% rename from zdata/demo/story/common/color/v1.yaml rename to test/data/demo/story/common/color/v1.yaml diff --git a/zdata/demo/story/common/date/v1.yaml b/test/data/demo/story/common/date/v1.yaml similarity index 100% rename from zdata/demo/story/common/date/v1.yaml rename to test/data/demo/story/common/date/v1.yaml diff --git a/zdata/demo/story/common/user/v1.yaml b/test/data/demo/story/common/user/v1.yaml similarity index 100% rename from zdata/demo/story/common/user/v1.yaml rename to test/data/demo/story/common/user/v1.yaml diff --git a/zdata/demo/story/config/config.yaml b/test/data/demo/story/config/config.yaml similarity index 100% rename from zdata/demo/story/config/config.yaml rename to test/data/demo/story/config/config.yaml diff --git a/zdata/demo/story/zt_action.yaml b/test/data/demo/story/zt_action.yaml similarity index 100% rename from zdata/demo/story/zt_action.yaml rename to test/data/demo/story/zt_action.yaml diff --git a/zdata/demo/story/zt_module.yaml b/test/data/demo/story/zt_module.yaml similarity index 100% rename from zdata/demo/story/zt_module.yaml rename to test/data/demo/story/zt_module.yaml diff --git a/zdata/demo/story/zt_product.yaml b/test/data/demo/story/zt_product.yaml similarity index 100% rename from zdata/demo/story/zt_product.yaml rename to test/data/demo/story/zt_product.yaml diff --git a/zdata/demo/story/zt_productplan.yaml b/test/data/demo/story/zt_productplan.yaml similarity index 100% rename from zdata/demo/story/zt_productplan.yaml rename to test/data/demo/story/zt_productplan.yaml diff --git a/zdata/demo/story/zt_project.yaml b/test/data/demo/story/zt_project.yaml similarity index 100% rename from zdata/demo/story/zt_project.yaml rename to test/data/demo/story/zt_project.yaml diff --git a/zdata/demo/story/zt_story.yaml b/test/data/demo/story/zt_story.yaml similarity index 100% rename from zdata/demo/story/zt_story.yaml rename to test/data/demo/story/zt_story.yaml diff --git a/zdata/demo/story/zt_storyspec.yaml b/test/data/demo/story/zt_storyspec.yaml similarity index 100% rename from zdata/demo/story/zt_storyspec.yaml rename to test/data/demo/story/zt_storyspec.yaml diff --git a/zdata/note.txt b/test/data/note.txt similarity index 100% rename from zdata/note.txt rename to test/data/note.txt diff --git a/zdata/zt_action.yaml b/test/data/zt_action.yaml similarity index 100% rename from zdata/zt_action.yaml rename to test/data/zt_action.yaml diff --git a/zdata/zt_activity.yaml b/test/data/zt_activity.yaml similarity index 100% rename from zdata/zt_activity.yaml rename to test/data/zt_activity.yaml diff --git a/zdata/zt_asset.yaml b/test/data/zt_asset.yaml similarity index 100% rename from zdata/zt_asset.yaml rename to test/data/zt_asset.yaml diff --git a/zdata/zt_attend.yaml b/test/data/zt_attend.yaml similarity index 100% rename from zdata/zt_attend.yaml rename to test/data/zt_attend.yaml diff --git a/zdata/zt_attendstat.yaml b/test/data/zt_attendstat.yaml similarity index 100% rename from zdata/zt_attendstat.yaml rename to test/data/zt_attendstat.yaml diff --git a/zdata/zt_auditcl.yaml b/test/data/zt_auditcl.yaml similarity index 100% rename from zdata/zt_auditcl.yaml rename to test/data/zt_auditcl.yaml diff --git a/zdata/zt_baseline.yaml b/test/data/zt_baseline.yaml similarity index 100% rename from zdata/zt_baseline.yaml rename to test/data/zt_baseline.yaml diff --git a/zdata/zt_basicmeas.yaml b/test/data/zt_basicmeas.yaml similarity index 100% rename from zdata/zt_basicmeas.yaml rename to test/data/zt_basicmeas.yaml diff --git a/zdata/zt_block.yaml b/test/data/zt_block.yaml similarity index 100% rename from zdata/zt_block.yaml rename to test/data/zt_block.yaml diff --git a/zdata/zt_branch.yaml b/test/data/zt_branch.yaml similarity index 100% rename from zdata/zt_branch.yaml rename to test/data/zt_branch.yaml diff --git a/zdata/zt_budget.yaml b/test/data/zt_budget.yaml similarity index 100% rename from zdata/zt_budget.yaml rename to test/data/zt_budget.yaml diff --git a/zdata/zt_bug.yaml b/test/data/zt_bug.yaml similarity index 100% rename from zdata/zt_bug.yaml rename to test/data/zt_bug.yaml diff --git a/zdata/zt_build.yaml b/test/data/zt_build.yaml similarity index 100% rename from zdata/zt_build.yaml rename to test/data/zt_build.yaml diff --git a/zdata/zt_burn.yaml b/test/data/zt_burn.yaml similarity index 100% rename from zdata/zt_burn.yaml rename to test/data/zt_burn.yaml diff --git a/zdata/zt_case.yaml b/test/data/zt_case.yaml similarity index 100% rename from zdata/zt_case.yaml rename to test/data/zt_case.yaml diff --git a/zdata/zt_casestep.yaml b/test/data/zt_casestep.yaml similarity index 100% rename from zdata/zt_casestep.yaml rename to test/data/zt_casestep.yaml diff --git a/zdata/zt_cmcl.yaml b/test/data/zt_cmcl.yaml similarity index 100% rename from zdata/zt_cmcl.yaml rename to test/data/zt_cmcl.yaml diff --git a/zdata/zt_company.yaml b/test/data/zt_company.yaml similarity index 100% rename from zdata/zt_company.yaml rename to test/data/zt_company.yaml diff --git a/zdata/zt_compile.yaml b/test/data/zt_compile.yaml similarity index 100% rename from zdata/zt_compile.yaml rename to test/data/zt_compile.yaml diff --git a/zdata/zt_config.yaml b/test/data/zt_config.yaml similarity index 100% rename from zdata/zt_config.yaml rename to test/data/zt_config.yaml diff --git a/zdata/zt_cron.yaml b/test/data/zt_cron.yaml similarity index 100% rename from zdata/zt_cron.yaml rename to test/data/zt_cron.yaml diff --git a/zdata/zt_deploy.yaml b/test/data/zt_deploy.yaml similarity index 100% rename from zdata/zt_deploy.yaml rename to test/data/zt_deploy.yaml diff --git a/zdata/zt_deployproduct.yaml b/test/data/zt_deployproduct.yaml similarity index 100% rename from zdata/zt_deployproduct.yaml rename to test/data/zt_deployproduct.yaml diff --git a/zdata/zt_deployscope.yaml b/test/data/zt_deployscope.yaml similarity index 100% rename from zdata/zt_deployscope.yaml rename to test/data/zt_deployscope.yaml diff --git a/zdata/zt_deploystep.yaml b/test/data/zt_deploystep.yaml similarity index 100% rename from zdata/zt_deploystep.yaml rename to test/data/zt_deploystep.yaml diff --git a/zdata/zt_dept.yaml b/test/data/zt_dept.yaml similarity index 100% rename from zdata/zt_dept.yaml rename to test/data/zt_dept.yaml diff --git a/zdata/zt_derivemeas.yaml b/test/data/zt_derivemeas.yaml similarity index 100% rename from zdata/zt_derivemeas.yaml rename to test/data/zt_derivemeas.yaml diff --git a/zdata/zt_design.yaml b/test/data/zt_design.yaml similarity index 100% rename from zdata/zt_design.yaml rename to test/data/zt_design.yaml diff --git a/zdata/zt_designspec.yaml b/test/data/zt_designspec.yaml similarity index 100% rename from zdata/zt_designspec.yaml rename to test/data/zt_designspec.yaml diff --git a/zdata/zt_doc.yaml b/test/data/zt_doc.yaml similarity index 100% rename from zdata/zt_doc.yaml rename to test/data/zt_doc.yaml diff --git a/zdata/zt_doccontent.yaml b/test/data/zt_doccontent.yaml similarity index 100% rename from zdata/zt_doccontent.yaml rename to test/data/zt_doccontent.yaml diff --git a/zdata/zt_doclib.yaml b/test/data/zt_doclib.yaml similarity index 100% rename from zdata/zt_doclib.yaml rename to test/data/zt_doclib.yaml diff --git a/zdata/zt_durationestimation.yaml b/test/data/zt_durationestimation.yaml similarity index 100% rename from zdata/zt_durationestimation.yaml rename to test/data/zt_durationestimation.yaml diff --git a/zdata/zt_effort.yaml b/test/data/zt_effort.yaml similarity index 100% rename from zdata/zt_effort.yaml rename to test/data/zt_effort.yaml diff --git a/zdata/zt_entry.yaml b/test/data/zt_entry.yaml similarity index 100% rename from zdata/zt_entry.yaml rename to test/data/zt_entry.yaml diff --git a/zdata/zt_extension.yaml b/test/data/zt_extension.yaml similarity index 100% rename from zdata/zt_extension.yaml rename to test/data/zt_extension.yaml diff --git a/zdata/zt_faq.yaml b/test/data/zt_faq.yaml similarity index 100% rename from zdata/zt_faq.yaml rename to test/data/zt_faq.yaml diff --git a/zdata/zt_feedback.yaml b/test/data/zt_feedback.yaml similarity index 100% rename from zdata/zt_feedback.yaml rename to test/data/zt_feedback.yaml diff --git a/zdata/zt_feedbackview.yaml b/test/data/zt_feedbackview.yaml similarity index 100% rename from zdata/zt_feedbackview.yaml rename to test/data/zt_feedbackview.yaml diff --git a/zdata/zt_file.yaml b/test/data/zt_file.yaml similarity index 100% rename from zdata/zt_file.yaml rename to test/data/zt_file.yaml diff --git a/zdata/zt_flow_audit.yaml b/test/data/zt_flow_audit.yaml similarity index 100% rename from zdata/zt_flow_audit.yaml rename to test/data/zt_flow_audit.yaml diff --git a/zdata/zt_flow_auditplan.yaml b/test/data/zt_flow_auditplan.yaml similarity index 100% rename from zdata/zt_flow_auditplan.yaml rename to test/data/zt_flow_auditplan.yaml diff --git a/zdata/zt_flow_auditresult.yaml b/test/data/zt_flow_auditresult.yaml similarity index 100% rename from zdata/zt_flow_auditresult.yaml rename to test/data/zt_flow_auditresult.yaml diff --git a/zdata/zt_flow_design.yaml b/test/data/zt_flow_design.yaml similarity index 100% rename from zdata/zt_flow_design.yaml rename to test/data/zt_flow_design.yaml diff --git a/zdata/zt_flow_designspec.yaml b/test/data/zt_flow_designspec.yaml similarity index 100% rename from zdata/zt_flow_designspec.yaml rename to test/data/zt_flow_designspec.yaml diff --git a/zdata/zt_flow_reviewlist.yaml b/test/data/zt_flow_reviewlist.yaml similarity index 100% rename from zdata/zt_flow_reviewlist.yaml rename to test/data/zt_flow_reviewlist.yaml diff --git a/zdata/zt_flow_stage.yaml b/test/data/zt_flow_stage.yaml similarity index 100% rename from zdata/zt_flow_stage.yaml rename to test/data/zt_flow_stage.yaml diff --git a/zdata/zt_flow_workloadbudget.yaml b/test/data/zt_flow_workloadbudget.yaml similarity index 100% rename from zdata/zt_flow_workloadbudget.yaml rename to test/data/zt_flow_workloadbudget.yaml diff --git a/zdata/zt_group.yaml b/test/data/zt_group.yaml similarity index 100% rename from zdata/zt_group.yaml rename to test/data/zt_group.yaml diff --git a/zdata/zt_grouppriv.yaml b/test/data/zt_grouppriv.yaml similarity index 100% rename from zdata/zt_grouppriv.yaml rename to test/data/zt_grouppriv.yaml diff --git a/zdata/zt_history.yaml b/test/data/zt_history.yaml similarity index 100% rename from zdata/zt_history.yaml rename to test/data/zt_history.yaml diff --git a/zdata/zt_holiday.yaml b/test/data/zt_holiday.yaml similarity index 100% rename from zdata/zt_holiday.yaml rename to test/data/zt_holiday.yaml diff --git a/zdata/zt_host.yaml b/test/data/zt_host.yaml similarity index 100% rename from zdata/zt_host.yaml rename to test/data/zt_host.yaml diff --git a/zdata/zt_issue.yaml b/test/data/zt_issue.yaml similarity index 100% rename from zdata/zt_issue.yaml rename to test/data/zt_issue.yaml diff --git a/zdata/zt_jenkins.yaml b/test/data/zt_jenkins.yaml similarity index 100% rename from zdata/zt_jenkins.yaml rename to test/data/zt_jenkins.yaml diff --git a/zdata/zt_job.yaml b/test/data/zt_job.yaml similarity index 100% rename from zdata/zt_job.yaml rename to test/data/zt_job.yaml diff --git a/zdata/zt_lang.yaml b/test/data/zt_lang.yaml similarity index 100% rename from zdata/zt_lang.yaml rename to test/data/zt_lang.yaml diff --git a/zdata/zt_leave.yaml b/test/data/zt_leave.yaml similarity index 100% rename from zdata/zt_leave.yaml rename to test/data/zt_leave.yaml diff --git a/zdata/zt_lieu.yaml b/test/data/zt_lieu.yaml similarity index 100% rename from zdata/zt_lieu.yaml rename to test/data/zt_lieu.yaml diff --git a/zdata/zt_log.yaml b/test/data/zt_log.yaml similarity index 100% rename from zdata/zt_log.yaml rename to test/data/zt_log.yaml diff --git a/zdata/zt_measqueue.yaml b/test/data/zt_measqueue.yaml similarity index 100% rename from zdata/zt_measqueue.yaml rename to test/data/zt_measqueue.yaml diff --git a/zdata/zt_measrecords.yaml b/test/data/zt_measrecords.yaml similarity index 100% rename from zdata/zt_measrecords.yaml rename to test/data/zt_measrecords.yaml diff --git a/zdata/zt_meastemplate.yaml b/test/data/zt_meastemplate.yaml similarity index 100% rename from zdata/zt_meastemplate.yaml rename to test/data/zt_meastemplate.yaml diff --git a/zdata/zt_module.yaml b/test/data/zt_module.yaml similarity index 100% rename from zdata/zt_module.yaml rename to test/data/zt_module.yaml diff --git a/zdata/zt_nc.yaml b/test/data/zt_nc.yaml similarity index 100% rename from zdata/zt_nc.yaml rename to test/data/zt_nc.yaml diff --git a/zdata/zt_notify.yaml b/test/data/zt_notify.yaml similarity index 100% rename from zdata/zt_notify.yaml rename to test/data/zt_notify.yaml diff --git a/zdata/zt_oauth.yaml b/test/data/zt_oauth.yaml similarity index 100% rename from zdata/zt_oauth.yaml rename to test/data/zt_oauth.yaml diff --git a/zdata/zt_object.yaml b/test/data/zt_object.yaml similarity index 100% rename from zdata/zt_object.yaml rename to test/data/zt_object.yaml diff --git a/zdata/zt_output.yaml b/test/data/zt_output.yaml similarity index 100% rename from zdata/zt_output.yaml rename to test/data/zt_output.yaml diff --git a/zdata/zt_overtime.yaml b/test/data/zt_overtime.yaml similarity index 100% rename from zdata/zt_overtime.yaml rename to test/data/zt_overtime.yaml diff --git a/zdata/zt_process.yaml b/test/data/zt_process.yaml similarity index 100% rename from zdata/zt_process.yaml rename to test/data/zt_process.yaml diff --git a/zdata/zt_product.yaml b/test/data/zt_product.yaml similarity index 100% rename from zdata/zt_product.yaml rename to test/data/zt_product.yaml diff --git a/zdata/zt_productplan.yaml b/test/data/zt_productplan.yaml similarity index 100% rename from zdata/zt_productplan.yaml rename to test/data/zt_productplan.yaml diff --git a/zdata/zt_programactivity.yaml b/test/data/zt_programactivity.yaml similarity index 100% rename from zdata/zt_programactivity.yaml rename to test/data/zt_programactivity.yaml diff --git a/zdata/zt_programoutput.yaml b/test/data/zt_programoutput.yaml similarity index 100% rename from zdata/zt_programoutput.yaml rename to test/data/zt_programoutput.yaml diff --git a/zdata/zt_programplan.yaml b/test/data/zt_programplan.yaml similarity index 100% rename from zdata/zt_programplan.yaml rename to test/data/zt_programplan.yaml diff --git a/zdata/zt_programprocess.yaml b/test/data/zt_programprocess.yaml similarity index 100% rename from zdata/zt_programprocess.yaml rename to test/data/zt_programprocess.yaml diff --git a/zdata/zt_programreport.yaml b/test/data/zt_programreport.yaml similarity index 100% rename from zdata/zt_programreport.yaml rename to test/data/zt_programreport.yaml diff --git a/zdata/zt_project.yaml b/test/data/zt_project.yaml similarity index 100% rename from zdata/zt_project.yaml rename to test/data/zt_project.yaml diff --git a/zdata/zt_projectproduct.yaml b/test/data/zt_projectproduct.yaml similarity index 100% rename from zdata/zt_projectproduct.yaml rename to test/data/zt_projectproduct.yaml diff --git a/zdata/zt_projectspec.yaml b/test/data/zt_projectspec.yaml similarity index 100% rename from zdata/zt_projectspec.yaml rename to test/data/zt_projectspec.yaml diff --git a/zdata/zt_projectstory.yaml b/test/data/zt_projectstory.yaml similarity index 100% rename from zdata/zt_projectstory.yaml rename to test/data/zt_projectstory.yaml diff --git a/zdata/zt_relation.yaml b/test/data/zt_relation.yaml similarity index 100% rename from zdata/zt_relation.yaml rename to test/data/zt_relation.yaml diff --git a/zdata/zt_relationoftasks.yaml b/test/data/zt_relationoftasks.yaml similarity index 100% rename from zdata/zt_relationoftasks.yaml rename to test/data/zt_relationoftasks.yaml diff --git a/zdata/zt_release.yaml b/test/data/zt_release.yaml similarity index 100% rename from zdata/zt_release.yaml rename to test/data/zt_release.yaml diff --git a/zdata/zt_repo.yaml b/test/data/zt_repo.yaml similarity index 100% rename from zdata/zt_repo.yaml rename to test/data/zt_repo.yaml diff --git a/zdata/zt_repobranch.yaml b/test/data/zt_repobranch.yaml similarity index 100% rename from zdata/zt_repobranch.yaml rename to test/data/zt_repobranch.yaml diff --git a/zdata/zt_repofiles.yaml b/test/data/zt_repofiles.yaml similarity index 100% rename from zdata/zt_repofiles.yaml rename to test/data/zt_repofiles.yaml diff --git a/zdata/zt_repohistory.yaml b/test/data/zt_repohistory.yaml similarity index 100% rename from zdata/zt_repohistory.yaml rename to test/data/zt_repohistory.yaml diff --git a/zdata/zt_report.yaml b/test/data/zt_report.yaml similarity index 100% rename from zdata/zt_report.yaml rename to test/data/zt_report.yaml diff --git a/zdata/zt_review.yaml b/test/data/zt_review.yaml similarity index 100% rename from zdata/zt_review.yaml rename to test/data/zt_review.yaml diff --git a/zdata/zt_reviewcl.yaml b/test/data/zt_reviewcl.yaml similarity index 100% rename from zdata/zt_reviewcl.yaml rename to test/data/zt_reviewcl.yaml diff --git a/zdata/zt_reviewissue.yaml b/test/data/zt_reviewissue.yaml similarity index 100% rename from zdata/zt_reviewissue.yaml rename to test/data/zt_reviewissue.yaml diff --git a/zdata/zt_reviewresult.yaml b/test/data/zt_reviewresult.yaml similarity index 100% rename from zdata/zt_reviewresult.yaml rename to test/data/zt_reviewresult.yaml diff --git a/zdata/zt_risk.yaml b/test/data/zt_risk.yaml similarity index 100% rename from zdata/zt_risk.yaml rename to test/data/zt_risk.yaml diff --git a/zdata/zt_score.yaml b/test/data/zt_score.yaml similarity index 100% rename from zdata/zt_score.yaml rename to test/data/zt_score.yaml diff --git a/zdata/zt_searchdict.yaml b/test/data/zt_searchdict.yaml similarity index 100% rename from zdata/zt_searchdict.yaml rename to test/data/zt_searchdict.yaml diff --git a/zdata/zt_searchindex.yaml b/test/data/zt_searchindex.yaml similarity index 100% rename from zdata/zt_searchindex.yaml rename to test/data/zt_searchindex.yaml diff --git a/zdata/zt_serverroom.yaml b/test/data/zt_serverroom.yaml similarity index 100% rename from zdata/zt_serverroom.yaml rename to test/data/zt_serverroom.yaml diff --git a/zdata/zt_service.yaml b/test/data/zt_service.yaml similarity index 100% rename from zdata/zt_service.yaml rename to test/data/zt_service.yaml diff --git a/zdata/zt_solutions.yaml b/test/data/zt_solutions.yaml similarity index 100% rename from zdata/zt_solutions.yaml rename to test/data/zt_solutions.yaml diff --git a/zdata/zt_sqlview.yaml b/test/data/zt_sqlview.yaml similarity index 100% rename from zdata/zt_sqlview.yaml rename to test/data/zt_sqlview.yaml diff --git a/zdata/zt_story.yaml b/test/data/zt_story.yaml similarity index 100% rename from zdata/zt_story.yaml rename to test/data/zt_story.yaml diff --git a/zdata/zt_storyspec.yaml b/test/data/zt_storyspec.yaml similarity index 100% rename from zdata/zt_storyspec.yaml rename to test/data/zt_storyspec.yaml diff --git a/zdata/zt_storystage.yaml b/test/data/zt_storystage.yaml similarity index 100% rename from zdata/zt_storystage.yaml rename to test/data/zt_storystage.yaml diff --git a/zdata/zt_suitecase.yaml b/test/data/zt_suitecase.yaml similarity index 100% rename from zdata/zt_suitecase.yaml rename to test/data/zt_suitecase.yaml diff --git a/zdata/zt_task.yaml b/test/data/zt_task.yaml similarity index 100% rename from zdata/zt_task.yaml rename to test/data/zt_task.yaml diff --git a/zdata/zt_taskestimate.yaml b/test/data/zt_taskestimate.yaml similarity index 100% rename from zdata/zt_taskestimate.yaml rename to test/data/zt_taskestimate.yaml diff --git a/zdata/zt_taskspec.yaml b/test/data/zt_taskspec.yaml similarity index 100% rename from zdata/zt_taskspec.yaml rename to test/data/zt_taskspec.yaml diff --git a/zdata/zt_team.yaml b/test/data/zt_team.yaml similarity index 100% rename from zdata/zt_team.yaml rename to test/data/zt_team.yaml diff --git a/zdata/zt_testreport.yaml b/test/data/zt_testreport.yaml similarity index 100% rename from zdata/zt_testreport.yaml rename to test/data/zt_testreport.yaml diff --git a/zdata/zt_testresult.yaml b/test/data/zt_testresult.yaml similarity index 100% rename from zdata/zt_testresult.yaml rename to test/data/zt_testresult.yaml diff --git a/zdata/zt_testrun.yaml b/test/data/zt_testrun.yaml similarity index 100% rename from zdata/zt_testrun.yaml rename to test/data/zt_testrun.yaml diff --git a/zdata/zt_testsuite.yaml b/test/data/zt_testsuite.yaml similarity index 100% rename from zdata/zt_testsuite.yaml rename to test/data/zt_testsuite.yaml diff --git a/zdata/zt_testtask.yaml b/test/data/zt_testtask.yaml similarity index 100% rename from zdata/zt_testtask.yaml rename to test/data/zt_testtask.yaml diff --git a/zdata/zt_todo.yaml b/test/data/zt_todo.yaml similarity index 100% rename from zdata/zt_todo.yaml rename to test/data/zt_todo.yaml diff --git a/zdata/zt_trip.yaml b/test/data/zt_trip.yaml similarity index 100% rename from zdata/zt_trip.yaml rename to test/data/zt_trip.yaml diff --git a/zdata/zt_user.yaml b/test/data/zt_user.yaml similarity index 100% rename from zdata/zt_user.yaml rename to test/data/zt_user.yaml diff --git a/zdata/zt_usercontact.yaml b/test/data/zt_usercontact.yaml similarity index 100% rename from zdata/zt_usercontact.yaml rename to test/data/zt_usercontact.yaml diff --git a/zdata/zt_usergroup.yaml b/test/data/zt_usergroup.yaml similarity index 100% rename from zdata/zt_usergroup.yaml rename to test/data/zt_usergroup.yaml diff --git a/zdata/zt_userquery.yaml b/test/data/zt_userquery.yaml similarity index 100% rename from zdata/zt_userquery.yaml rename to test/data/zt_userquery.yaml diff --git a/zdata/zt_usertpl.yaml b/test/data/zt_usertpl.yaml similarity index 100% rename from zdata/zt_usertpl.yaml rename to test/data/zt_usertpl.yaml diff --git a/zdata/zt_userview.yaml b/test/data/zt_userview.yaml similarity index 100% rename from zdata/zt_userview.yaml rename to test/data/zt_userview.yaml diff --git a/zdata/zt_webhook.yaml b/test/data/zt_webhook.yaml similarity index 100% rename from zdata/zt_webhook.yaml rename to test/data/zt_webhook.yaml diff --git a/zdata/zt_weeklyreport.yaml b/test/data/zt_weeklyreport.yaml similarity index 100% rename from zdata/zt_weeklyreport.yaml rename to test/data/zt_weeklyreport.yaml diff --git a/zdata/zt_workestimation.yaml b/test/data/zt_workestimation.yaml similarity index 100% rename from zdata/zt_workestimation.yaml rename to test/data/zt_workestimation.yaml diff --git a/zdata/zt_workflow.yaml b/test/data/zt_workflow.yaml similarity index 100% rename from zdata/zt_workflow.yaml rename to test/data/zt_workflow.yaml diff --git a/zdata/zt_workflowaction.yaml b/test/data/zt_workflowaction.yaml similarity index 100% rename from zdata/zt_workflowaction.yaml rename to test/data/zt_workflowaction.yaml diff --git a/zdata/zt_workflowdatasource.yaml b/test/data/zt_workflowdatasource.yaml similarity index 100% rename from zdata/zt_workflowdatasource.yaml rename to test/data/zt_workflowdatasource.yaml diff --git a/zdata/zt_workflowfield.yaml b/test/data/zt_workflowfield.yaml similarity index 100% rename from zdata/zt_workflowfield.yaml rename to test/data/zt_workflowfield.yaml diff --git a/zdata/zt_workflowlabel.yaml b/test/data/zt_workflowlabel.yaml similarity index 100% rename from zdata/zt_workflowlabel.yaml rename to test/data/zt_workflowlabel.yaml diff --git a/zdata/zt_workflowlayout.yaml b/test/data/zt_workflowlayout.yaml similarity index 100% rename from zdata/zt_workflowlayout.yaml rename to test/data/zt_workflowlayout.yaml diff --git a/zdata/zt_workflowlinkdata.yaml b/test/data/zt_workflowlinkdata.yaml similarity index 100% rename from zdata/zt_workflowlinkdata.yaml rename to test/data/zt_workflowlinkdata.yaml diff --git a/zdata/zt_workflowrelation.yaml b/test/data/zt_workflowrelation.yaml similarity index 100% rename from zdata/zt_workflowrelation.yaml rename to test/data/zt_workflowrelation.yaml diff --git a/zdata/zt_workflowrelationlayout.yaml b/test/data/zt_workflowrelationlayout.yaml similarity index 100% rename from zdata/zt_workflowrelationlayout.yaml rename to test/data/zt_workflowrelationlayout.yaml diff --git a/zdata/zt_workflowrule.yaml b/test/data/zt_workflowrule.yaml similarity index 100% rename from zdata/zt_workflowrule.yaml rename to test/data/zt_workflowrule.yaml diff --git a/zdata/zt_workflowsql.yaml b/test/data/zt_workflowsql.yaml similarity index 100% rename from zdata/zt_workflowsql.yaml rename to test/data/zt_workflowsql.yaml diff --git a/zdata/zt_workflowversion.yaml b/test/data/zt_workflowversion.yaml similarity index 100% rename from zdata/zt_workflowversion.yaml rename to test/data/zt_workflowversion.yaml diff --git a/test/init.php b/test/lib/init.php similarity index 89% rename from test/init.php rename to test/lib/init.php index 292c107b64..c2f75be790 100644 --- a/test/init.php +++ b/test/lib/init.php @@ -15,7 +15,7 @@ /* Set the error reporting. */ error_reporting(E_ALL & E_STRICT); -$frameworkRoot = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR; +$frameworkRoot = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR; /* Load the framework. */ include $frameworkRoot . 'router.class.php'; @@ -26,8 +26,9 @@ include $frameworkRoot . 'helper.class.php'; $app = router::createApp('pms', dirname(dirname(__FILE__)), 'router'); $tester = $app->loadCommon(); -$config->zendataRoot = dirname(__FILE__) . DS . 'zendata'; -$config->zdPath = __DIR__ . "/runtime/zd/zd"; +$config->zendataRoot = dirname(dirname(__FILE__)) . '/zendata'; +$config->ztfPath = dirname(dirname(__FILE__)) . '/tools/ztf'; +$config->zdPath = dirname(dirname(__FILE__)) . '/tools/zd'; /** * Save variable to $_result. diff --git a/test/lib/result.php b/test/lib/result.php new file mode 100644 index 0000000000..891fc244db --- /dev/null +++ b/test/lib/result.php @@ -0,0 +1,49 @@ + + * @package ZenTaoPMS + * @version $Id: $ + * @link http://www.zentao.net + */ +class result +{ + /** + * Original run result. + * + * @var mixed + * @access private + */ + private $runResult; + + /** + * Properties for testing. + * + * @var string + * @access private + */ + private $properties = ''; + + /** + * Check properties of result. + * + * @param string $fields If fields is empty, print result. + * @access public + */ + public function check($properties) + { + $this->properties = $properties; + } + + public function expect($expect) + { + if($this->properties) + { + } + } +} diff --git a/test/lib/utils.php b/test/lib/utils.php new file mode 100644 index 0000000000..403f6c9faf --- /dev/null +++ b/test/lib/utils.php @@ -0,0 +1,129 @@ + + * @package ZenTaoPMS + * @version $Id: $ + * @link http://www.zentao.net + */ + +/** + * Run test cases of a directory using ztf. + * + * @param string $dir + * @access public + * @return void + */ +function ztfRun($dir) +{ + global $config; + + $ztfPath = dirname(dirname(__FILE__)) . '/tools/ztf'; + $command = "$ztfPath $dir"; + system($command); +} + +/** + * Run scripts of a directory using zendata. + * + * @param string $dir + * @access public + * @return void + */ +function zdRun($dir) +{ + $frameworkRoot = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR; + include $frameworkRoot . 'helper.class.php'; + + $zdRoot = dirname(dirname(__FILE__)) . '/' . $dir; + $zdPath = dirname(dirname(__FILE__)) . '/tools/zd'; + + set_time_limit(0); + try + { + $config = new stdclass(); + $config->db = new stdclass(); + include dirname(dirname(dirname(__FILE__))) . '/config/my.php'; + + $dsn = "mysql:host={$config->db->host}:{$config->db->port};dbname={$config->db->name}"; + $dbh = new PDO($dsn, $config->db->user, $config->db->password); + echo 'Connect success' . PHP_EOL; + + $command = "$zdPath -c $zdRoot/%s -d %s -n %s -o $zdRoot/sql/%s.sql -table %s"; + $yamlFilePath = scandir($zdRoot); + foreach($yamlFilePath as $file) + { + if(strpos($file, '.yaml')) + { + $fileName = basename($file, '.yaml'); + $count = isset($zdataCount[$fileName]) ? $zdataCount[$fileName] : 10; + $execYaml = sprintf($command, $file, $file, $count, $fileName, $fileName); + exec($execYaml); // create sql files. + + echo 'Execute:' . $execYaml . PHP_EOL; + } + } + + /* Export SQL files to mysql. */ + $sqlDir = $dirPath . '/sql/'; + $sqlFilePath = scandir($sqlDir); + + $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // 设置报错处理方式。 + $dbh->exec("SET GLOBAL sql_mode = '';"); + $dbh->exec("set names 'utf8'"); + $dbh->beginTransaction(); + + foreach($sqlFilePath as $file) + { + if(strpos($file, '.sql')) + { + $tableName = basename($file, '.sql'); + + $truncate = 'truncate table ' . $tableName; + $dbh->exec($truncate); + + $sql = file_get_contents($sqlDir . $file); + $count = $dbh->exec($sql); + echo $tableName . '表影响行数:' . $count . PHP_EOL; + } + } + + $dbh->commit(); + $dbh = null; + } + catch (PDOException $e) + { + die('Error!: ' . $e->getMessage() . PHP_EOL); + } +} + +/** + * Print usage of zdtest. + * + * @access public + * @return void + */ +function printUsage() +{ + echo << + + The commands are: + + init only init data and files + control run unit test for controllers + model run unit test for models + ui ui testing + all run all tests + clean remove data, files and cached files + + +EOT; +} diff --git a/test/model/branch/getbyid.php b/test/model/branch/getbyid.php index b00216ecf6..928829dbbb 100755 --- a/test/model/branch/getbyid.php +++ b/test/model/branch/getbyid.php @@ -4,23 +4,11 @@ title=测试 branchModel::getById(); cid=1 pid=1 - -使用branchID获取一个存在的分支 >> A -使用branchID和productID获取一个存在的分支 >> B -使用branchID获取一个不存在的分支 >> */ -include dirname(dirname(__DIR__)) . '/init.php'; +include dirname(dirname(__DIR__)) . '/lib/init.php'; $branch = $tester->loadModel('branch'); -$app->dbh->query("truncate zt_product"); -$app->dbh->query("truncate zt_branch"); - -zdImport(TABLE_PRODUCT, "zendata/product.yaml", 10); -zdImport(TABLE_BRANCH, "zendata/branch.yaml", 10); - -/* Group 1. */ -run($branch->getByID(1)) and expect('name'); // Step 1.1. -run($branch->getByID(2, 2)) and expect('name'); // Step 1.2. -run($branch->getByID(null)) and expect('name'); // Step 1.3. +/* group: 1. */ +r($branch->getByID(1)) && p('name') && e('A'); // step: 1.1 使用branchID获取一个存在的分支. >> diff --git a/test/zendata/branch.yaml b/test/zendata/branch.yaml deleted file mode 100644 index d1b5988585..0000000000 --- a/test/zendata/branch.yaml +++ /dev/null @@ -1,37 +0,0 @@ -title: table zt_branch -desc: "分支信息" -author: liyuchun -version: "1.0" -fields: - - field: id - note: "ID" - range: 1-10 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: product - note: "所属产品" - range: 1-2{5} - prefix: "" - postfix: "\t" - format: "" - - field: name - note: "分支名称" - range: A-Z - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: order - note: "排序" - range: 1-10 - prefix: "" - postfix: "\t" - format: "" - - field: deleted - note: "是否删除" - range: 0 - prefix: "" - postfix: "\t" - format: "" diff --git a/test/zendata/gapanalysis.yaml b/test/zendata/gapanalysis.yaml deleted file mode 100644 index 7b3832475e..0000000000 --- a/test/zendata/gapanalysis.yaml +++ /dev/null @@ -1,32 +0,0 @@ -title: 'table zt_gapanalysis' -desc: "" -author: automated export -version: "1.0" -fields: - - field: id - range: 1-6 - - field: project - range: 13 - - field: account - range: [admin,dev1,dev2,qa1,qa2] - - field: role - range: []{1},[研发]{2},[测试]{2} - - field: definition - range: a-z:R - - field: analysis - range: A-Z:R - - field: isTrain - range: 0-2:R - - field: createdBy - range: admin - - field: createdDate - range: "(-1M)-(+1w):60" - prefix: DateTime - type: timestamp - format: "YY/MM/DD hh:mm:ss" - - field: editedBy - range: ' ' - - field: editedDate - range: [0000-00-00 00:00:00] - - field: deleted - range: 0 diff --git a/test/zendata/product.yaml b/test/zendata/product.yaml deleted file mode 100644 index b884d78c25..0000000000 --- a/test/zendata/product.yaml +++ /dev/null @@ -1,130 +0,0 @@ -title: table zt_product -desc: "产品信息" -author: liyuchun -version: "1.0" -fields: - - field: id - note: "ID" - range: 1-11 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: program - note: "所属项目集" - range: 0 - prefix: "" - postfix: "\t" - format: "" - - field: name - note: "产品名称" - range: A-Z - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: code - note: "代号" - range: A-Z - prefix: "" - postfix: "\t" - format: "" - - field: bind - note: "是否绑定" - range: 0 - prefix: "" - postfix: "\t" - format: "" - - field: line - note: "产品线" - range: 0 - prefix: "" - postfix: "\t" - format: "" - - field: type - note: "类型" - range: [branch,normal]{5} - prefix: "" - postfix: "\t" - format: "" - - field: status - note: "状态" - range: "normal" - prefix: "" - postfix: "\t" - format: "" - - field: desc - note: "描述" - range: "批量创建产品" - prefix: "" - postfix: "\t" - format: "" - - field: PO - note: "产品负责人" - range: "admin" - prefix: "" - postfix: "\t" - format: "" - - field: QD - note: "测试负责人" - range: "admin" - prefix: "" - postfix: "\t" - format: "" - - field: RD - note: "发布负责人" - range: "admin" - prefix: "" - postfix: "\t" - format: "" - - field: feedback - range: "" - prefix: "" - postfix: "\t" - format: "" - - field: storyConcept - range: 0 - prefix: "" - postfix: "\t" - format: "" - - field: acl - note: "权限" - range: [open,private]{5} - prefix: "" - postfix: "\t" - format: "" - - field: storyConcept - range: 0 - prefix: "" - postfix: "\t" - format: "" - - field: whitelist - range: "" - prefix: "," - postfix: "\t" - format: "" - - field: createdBy - range: "admin" - prefix: "" - postfix: "\t" - format: "" - - field: createdDate - range: "(-1M)-(+1w):60" - prefix: DateTime - type: timestamp - format: "YY/MM/DD hh:mm:ss" - - field: createdVersion - range: "max2.0" - prefix: "" - postfix: "\t" - format: "" - - field: order - range: 1-10 - prefix: "" - postfix: "\t" - format: "" - - field: deleted - range: 0 - prefix: "" - postfix: "\t" - format: "" diff --git a/test/zendata/trainplan.yaml b/test/zendata/trainplan.yaml deleted file mode 100644 index cc4ceae960..0000000000 --- a/test/zendata/trainplan.yaml +++ /dev/null @@ -1,48 +0,0 @@ -title: 'table zt_trainplan ' -desc: "" -author: automated export -version: "1.0" -fields: - - field: id - range: 1-100000 - - field: project - range: 1-100 - - field: name - range: 1-100000 - format: "培训计划_%d" - - field: begin - range: "(-1M)-(+1w):60" - prefix: DateTime - type: timestamp - format: "YY/MM/DD hh:mm:ss" - - field: end - range: "(-1M)-(+1w):60" - prefix: DateTime - type: timestamp - format: "YY/MM/DD hh:mm:ss" - - field: place - range: 1-10 - format: "地点_%d" - - field: trainee - range: admin,jia,yiyi - - field: lecturer - range: hufangzhou - - field: type - range: outside,inside - - field: status - range: wait,done - - field: summary - range: ' ' - - field: createdBy - range: admin - - field: createdDate - range: "(-1M)-(+1w):60" - prefix: DateTime - type: timestamp - format: "YY/MM/DD hh:mm:ss" - - field: editedBy - range: ' ' - - field: editedDate - range: ' ' - - field: deleted - range: 0 diff --git a/test/zendata/user.yaml b/test/zendata/user.yaml deleted file mode 100644 index 5acb5c1855..0000000000 --- a/test/zendata/user.yaml +++ /dev/null @@ -1,256 +0,0 @@ -title: table zt_user -desc: "用户信息" -author: automated export -version: "1.0" -fields: - - field: id - note: "ID" - range: 1-10000 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: dept - note: "所属部门" - range: 1-10000 - prefix: "" - postfix: "\t" - format: "" - - field: account - note: "用户名" - from: name.enaccount.v1.yaml - use: common_underline - postfix: "\t" # 后缀,特殊字符加引号,否则无法解析。 - format: "" - - field: password - note: "密码" - range: 123456 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: role - note: "职位" - range: qa,dev,pm,po,td,pd,qd,top,market,service,operation,support,others - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: realname - note: "真实姓名" - from: name.cnreal.v1.yaml - use: three - format: "" - - field: nickname - note: "昵称" - from: name.enaccount.v1.yaml - use: common - postfix: "\t" - loop: 0 - - field: commiter - note: "源代码帐号" - from: name.enaccount.v1.yaml - use: common - postfix: "@zentao.net" - loop: 0 - format: "" - - field: avatar - note: "" - range: 0 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: birthday - note: "生日" - from: time.date.v1.yaml - use: date - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: gender - note: "性别" - range: f,m - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: email - note: "邮箱" - range: 1-10000 - prefix: "这里是邮箱" - postfix: "\t" - loop: 0 - format: "" - - field: skype - note: "Skype" - range: Skype - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: qq - note: "QQ" - range: QQ - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: mobile - note: "手机" - range: mobile - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: phone - note: "电话" - range: phone - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: weixin - note: "微信" - range: weixin - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: dingding - note: "钉钉" - range: dingding - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: slack - note: "Slack" - range: slack - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: whatsapp - note: "WhatsApp" - range: whatsApp - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: address - note: "通讯地址" - range: 1-10000 - prefix: "这是通讯地址" - postfix: "\t" - loop: 0 - format: "" - - field: zipcode - note: "邮编" - range: 1-10000 - prefix: "这是邮编" - postfix: "\t" - loop: 0 - format: "" - - field: join - note: "入职日期" - from: time.date.v1.yaml - use: date - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: visits - note: "访问次数" - range: 0-10000:R - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: ip - note: "最后IP" - from: ip.v1.yaml - use: ipA,ipB - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: last - note: "最后登录" - range: 1-10000 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: fails - note: "失败次数" - range: 1-10000 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: locked - note: "锁定时间" - from: time.date.v1.yaml - use: date - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: feedback - note: "反馈[非研发]" - range: 0 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: ranzhi - note: "ZDOO账号" - range: 0 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: ldap - note: "" - range: 0 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: score - note: "积分" - range: 1-10000:R - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: scoreLevel - note: "积分等级" - range: 0 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: deleted - note: "是否删除" - range: 0 - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: clientStatus - note: "连接状态" - range: offline - prefix: "" - postfix: "\t" - loop: 0 - format: "" - - field: clientLang - note: "连接语言" - range: en - prefix: "" - postfix: "\t" - loop: 0 - format: "" diff --git a/test/ztest b/test/ztest new file mode 100755 index 0000000000..8b4da4e85c --- /dev/null +++ b/test/ztest @@ -0,0 +1,22 @@ +#!/usr/bin/env php +