From 4e10ea8fe6fbbcf6720db7d8b03a87bd506611aa Mon Sep 17 00:00:00 2001 From: liyang Date: Fri, 9 Sep 2022 16:05:02 +0800 Subject: [PATCH] * Fix code format. --- test/lib/init.php | 2 +- test/lib/initapi.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/lib/init.php b/test/lib/init.php index 17f067a466..6295833f11 100644 --- a/test/lib/init.php +++ b/test/lib/init.php @@ -61,7 +61,7 @@ $config->zdPath = dirname(dirname(__FILE__)) . '/tools/zd'; include $testPath . 'config/config.php'; include $testPath. 'lib/db.class.php'; include $testPath. 'lib/rest.php'; -$db = new db(); +$db = new db(); $rest = new rest($config->test->base); if(isset($config->test->account, $config->test->password)) diff --git a/test/lib/initapi.php b/test/lib/initapi.php index edeaa496a1..b7270bd63e 100644 --- a/test/lib/initapi.php +++ b/test/lib/initapi.php @@ -58,7 +58,7 @@ function getApi($apiRoot, $apiFiles, $info = false) } } - if($info === true) echo '没有数据库数据:' . PHP_EOL . $nodata . PHP_EOL . '没有API文件:' . PHP_EOL .$noApiFile . PHP_EOL; + if($info === true) echo '没有数据库数据:' . PHP_EOL . $nodata . PHP_EOL . '没有API文件:' . PHP_EOL . $noApiFile . PHP_EOL; return $api; } @@ -76,8 +76,7 @@ function setValue($values) $result .= "'$field' => '$value', "; } } - $result = trim($result, ", "); - $result .= ')'; + $result = trim($result, ", ") . ')'; return $result; } @@ -123,7 +122,6 @@ function createCase($caseRoot, $apiList) if($methodValue['example'] !== '') { $testData = "array("; - $examples = json_decode(str_replace('"', '"', $methodValue['example']), true); foreach($examples as $key => $value)