#!/usr/bin/env php gen(10); zenData('task')->gen(10); zenData('bug')->gen(10); zenData('relation')->loadYaml('relation')->gen(10); su('admin'); global $tester; $mrModel = $tester->loadModel('mr'); /* MR id and product and type is right. */ $linkedStories = $mrModel->getLinkList(1, 'story'); r(count($linkedStories)) && p() && e('4'); // 查询关联的需求数量 r($linkedStories) && p('1:title;10:title') && e('用户需求1,软件需求10'); // 查询关联的需求列表 r($mrModel->getLinkList(1, 'task')) && p('2:name;8:name') && e('开发任务12,开发任务18'); // 查询关联的任务列表 r($mrModel->getLinkList(1, 'bug')) && p('3:title;9:title') && e('BUG3,BUG9'); // 查询关联的Bug列表 /* MR id is right, but product is wrong. */ r(count($mrModel->getLinkList(1, 'story'))) && p() && e('4'); // 查询关联的需求数量 /* MR id is wrong, but product is right. */ r(count($mrModel->getLinkList(2, 'story'))) && p() && e('0'); // 查询关联的需求数量 /* MR id and product is right, type is wrong. */ r(count($mrModel->getLinkList(1, 'story1'))) && p() && e('0'); // 查询关联的需求数量