* Add testcase of kanban module.
This commit is contained in:
@@ -162,7 +162,7 @@ $lang->action->desc->hidden = '$date, hidden by <strong>$actor</st
|
||||
$lang->action->desc->commented = '$date, added by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->activated = '$date, activated by <strong>$actor</strong> .' . "\n";
|
||||
$lang->action->desc->blocked = '$date, blocked by <strong>$actor</strong> .' . "\n";
|
||||
$lang->action->desc->moved = '$date, moved by <strong>$actor</strong> .' . "\n";
|
||||
$lang->action->desc->moved = '$date, moved by <strong>$actor</strong> .' . "\n";
|
||||
$lang->action->desc->confirmed = '$date, <strong>$actor</strong> confirmed the story change. The latest build is <strong>#$extra</strong>.' . "\n";
|
||||
$lang->action->desc->caseconfirmed = '$date, <strong>$actor</strong> confirmed the case change. The latest build is <strong>#$extra</strong>' . "\n";
|
||||
$lang->action->desc->bugconfirmed = '$date, <strong>$actor</strong> confirmed Bug.' . "\n";
|
||||
|
||||
@@ -3584,10 +3584,7 @@ class kanbanModel extends model
|
||||
/* Set toList and ccList. */
|
||||
$toList = $card->createdBy;
|
||||
$ccList = trim($card->assignedTo, ',');
|
||||
if(strpos(",$ccList,", ",$card->createdBy,") === false)
|
||||
{
|
||||
$ccList .= ",$card->createdBy";
|
||||
}
|
||||
if(strpos(",$ccList,", ",$card->createdBy,") === false) $ccList .= ",$card->createdBy";
|
||||
|
||||
if(empty($toList))
|
||||
{
|
||||
|
||||
@@ -1733,6 +1733,22 @@ class kanbanTest
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get toList and ccList.
|
||||
*
|
||||
* @param object $card
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getToAndCcListTest($card)
|
||||
{
|
||||
$objects = $this->objectModel->getToAndCcList($card);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test check if user can execute an action.
|
||||
*
|
||||
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->getToAndCcList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取id=1的卡片发信人员 >> admin;admin
|
||||
|
||||
*/
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
$card = $kanban->getCardByIDTest('1');
|
||||
r($kanban->getToAndCcListTest($card)) && p('0;1') && e('admin;admin'); // 获取id=1的卡片发信人员
|
||||
Reference in New Issue
Block a user