* Compatible for php8.1.

This commit is contained in:
wangyidong
2022-08-29 11:19:31 +08:00
parent 0fc0a2684e
commit 8d56ef8891
15 changed files with 1121 additions and 1118 deletions
+2 -2
View File
@@ -113,7 +113,7 @@ r($admin->create($wrongProductBug)) && c(400) && p('error') && e('product does n
/* Test get. */
$bug = $admin->create($normalBug);
r($admin->get($bug->id)) && c(200) && p($fields) && e('Bug2');
r($admin->get(9999999) && c(400) && p('error') && e('');
r($admin->get(9999999)) && c(400) && p('error') && e('');
r($noProduct1User->get($bug->id)) && c(403) && p('error') && e('');
r($admin->getList(1)) && c(200) && p('0:title') && e('Bug1');
@@ -129,4 +129,4 @@ r($admin->put($modifyBug2)) && c(200) && p($fields) && e('Bug3');
/* Test delete*/
r($admin->delete($bug->id)) && c(201) && p() && e('');
r($admin->get($bug->id)) && c(200) && p('bug:deleted') && e('true');
r($admin->get($bug->id)) && c(200) && p('bug:deleted') && e('true');
+2 -2
View File
@@ -292,11 +292,11 @@ class buildTest
*
* @param int $buildID
* @param array $stories
* @param innt $storyID
* @param int $storyID
* @access public
* @return array
*/
public function unlinkStoryTest($buildID, $stories = array(), $storyID)
public function unlinkStoryTest($buildID, $stories = array(), $storyID = 0)
{
global $tester;
+1 -1
View File
@@ -302,7 +302,7 @@ class customTest
* @access public
* @return object
*/
public function updateURAndSRTest($key = 0, $SRName)
public function updateURAndSRTest($key = 0, $SRName = '')
{
global $app, $tester;
+2 -2
View File
@@ -296,7 +296,7 @@ class deptTest
* @access public
* @return array
*/
public function getUsersTest($browseType = 'inside', $deptID = 0, $count, $orderBy = 'id', $pager = null)
public function getUsersTest($browseType = 'inside', $deptID = 0, $count = 0, $orderBy = 'id', $pager = null)
{
$objects = $this->objectModel->getUsers($browseType, $deptID, $pager, $orderBy);
@@ -317,7 +317,7 @@ class deptTest
* @access public
* @return array
*/
public function getDeptUserPairsTest($deptID = 0, $count, $key = 'account', $type = 'inside', $params = '')
public function getDeptUserPairsTest($deptID = 0, $count = 0, $key = 'account', $type = 'inside', $params = '')
{
$objects = $this->objectModel->getDeptUserPairs($deptID, $key, $type, $params);
+3 -3
View File
@@ -58,7 +58,7 @@ class executionTest
* @access public
* @return array
*/
public function createObject($param = array(), $project, $dayNum, $days)
public function createObject($param = array(), $project = '', $dayNum = '', $days = '')
{
$products = array('');
$plans = array('');
@@ -1511,7 +1511,7 @@ class executionTest
* @access public
* @return array
*/
public function getCanCopyObjectsTest($projectID = 0, $count)
public function getCanCopyObjectsTest($projectID = 0, $count = 0)
{
$object = $this->objectModel->getCanCopyObjects($projectID);
@@ -1601,7 +1601,7 @@ class executionTest
* @access public
* @return array
*/
public function addProjectMembersTest($projectID = 0, $executionID, $count)
public function addProjectMembersTest($projectID = 0, $executionID = 0, $count = 0)
{
global $tester;
$tester->dbh->query("delete from zt_team where root = $projectID");
+1 -1
View File
@@ -280,7 +280,7 @@ class personnelTest
* @access public
* @return void
*/
public function addWhitelistTest($objectType = '', $objectID = 0, $user)
public function addWhitelistTest($objectType = '', $objectID = 0, $user = '')
{
$users = array('accounts' => $user);
foreach($users as $key => $value) $_POST[$key] = $value;
+5 -3
View File
@@ -95,7 +95,7 @@ class releaseTest
$files = array();
$mailto = array();
$createFields = array('name' => '','marker' => '1', 'build' => '', 'date' => $date, 'desc' => '', 'mailto' => $mailto , 'labels' => $labels, 'files' => $files);
$createFields = array('name' => '','marker' => '1', 'build' => '', 'date' => $date, 'desc' => '', 'mailto' => $mailto , 'labels' => $labels, 'files' => $files);
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
@@ -230,11 +230,12 @@ class releaseTest
*
* @param int $releaseID
* @param string $type
* @param string $bugs
* @access public
* @return array
*/
public function linkBugTest($releaseID, $type = 'bug', $bugs)
public function linkBugTest($releaseID, $type = 'bug', $bugs = '')
{
$_POST['bugs'] = $bugs;
$this->objectModel->linkBug($releaseID, $type);
@@ -275,10 +276,11 @@ class releaseTest
*
* @param int $releaseID
* @param string $type
* @param string $bugs
* @access public
* @return array
*/
public function batchUnlinkBugTest($releaseID, $type = 'bug', $bugs)
public function batchUnlinkBugTest($releaseID, $type = 'bug', $bugs = '')
{
$_POST['bugs'] = $bugs;
$this->objectModel->linkBug($releaseID);
+4 -3
View File
@@ -115,10 +115,11 @@ class storyTest
* @param int $bugID
* @param string $from
* @param string $extra
* @param string $params
* @access public
* @return void
*/
public function createTest($executionID = 0, $bugID = 0, $from = '', $extra = '', $params)
public function createTest($executionID = 0, $bugID = 0, $from = '', $extra = '', $params = '')
{
$_POST = $params;
$result = $this->objectModel->create($executionID, $bugID, $from, $extra);
@@ -159,7 +160,7 @@ class storyTest
* @access public
* @return void
*/
public function batchCreateTest($productID = 0, $branch = 0, $type = 'story', $params)
public function batchCreateTest($productID = 0, $branch = 0, $type = 'story', $params = '')
{
$_POST = $params;
$results = $this->objectModel->batchCreate($productID, $branch, $type);
@@ -451,7 +452,7 @@ class storyTest
* @access public
* @return void
*/
public function batchToTaskTest($executionID, $projectID = 0, $params)
public function batchToTaskTest($executionID, $projectID = 0, $params = '')
{
$_POST = $params;
$taskIdList = $this->objectModel->batchToTask($executionID, $projectID);