parase_file($file); $total += $amount; Log::record("total={$total} {$file} amount = {$amount}",Log::DEBUG); } Log::record("total = {$total}",Log::DEBUG); } private function parase_file($file) { $fn = fopen(BASE_ROOT_PATH . "/data/amount/{$file}", "r"); $total_amount = ncPriceFormat(0.00); $i = 0; while (!feof($fn)) { $i++; $line = trim(fgets($fn)); $ret = preg_match('/[\w\W]+UPDATE[\w\W]+available_predeposit=available_predeposit(?P[-+]+)(?P[.\d]+)/i', $line, $matches); if ($ret) { $oper = $matches['oper']; $amount = $matches['amount']; if ($oper == '-') { $total_amount = ncPriceFormat($total_amount) - ncPriceFormat($amount); } else { $total_amount = ncPriceFormat($total_amount) + ncPriceFormat($amount); } Log::record("index = {$i} {$total_amount} = {$total_amount} {$oper} {$amount}", Log::DEBUG); } } Log::record("total_amount:{$total_amount}", Log::DEBUG); fclose($fn); return $total_amount; } } //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccount::testLog)( .*)?$/" --test-suffix TestAccount.php /var/www/html/test