fix terbaru

This commit is contained in:
Amal Udjir 2025-05-09 05:11:53 +07:00
commit 26f9e2ed8b
2 changed files with 60 additions and 53 deletions

View File

@ -1,6 +1,6 @@
APP_NAME=iCLOP APP_NAME=iCLOP
APP_ENV=local APP_ENV=local
APP_KEY= APP_KEY=base64:7PMb8dvpBWcRs5AMi3nEDHitF2MvqgC9QbOvCE5dvDo=
APP_DEBUG=true APP_DEBUG=true
APP_URL=http://localhost APP_URL=http://localhost
@ -11,10 +11,16 @@ LOG_LEVEL=debug
DB_CONNECTION=mysql DB_CONNECTION=mysql
DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
DB_PORT=3306 DB_PORT=3306
DB_DATABASE=laravel DB_DATABASE=iclop
DB_USERNAME=root DB_USERNAME=root
DB_PASSWORD= DB_PASSWORD=
DB_HOST_SECOND=127.0.0.1
DB_PORT_SECOND=3306
DB_DATABASE_SECOND=test_db
DB_USERNAME_SECOND=root
DB_PASSWORD_SECOND=
NODEJS_DB_HOST=127.0.0.1 NODEJS_DB_HOST=127.0.0.1
NODEJS_DB_PORT=3306 NODEJS_DB_PORT=3306
NODEJS_DB_DATABASE=iclop_nodejs NODEJS_DB_DATABASE=iclop_nodejs

View File

@ -301,8 +301,10 @@ function unittesting(){
$text = str_replace("\n", ' ', $output); $text = str_replace("\n", ' ', $output);
$cleaned = preg_replace('/\e\[[;?\d]*m/', '', $string); $cleaned = preg_replace('/\e\[[;?\d]*m/', '', $string);
// Pola regex untuk mengekstrak versi Codeception
$pattern = '/Codeception PHP Testing Framework v([\d.]+)/'; $pattern = '/Codeception PHP Testing Framework v([\d.]+)/';
// Define patterns to extract relevant information
$pattern_phpunit_version = '/PHPUnit\s+([\d.]+)\s+by/'; $pattern_phpunit_version = '/PHPUnit\s+([\d.]+)\s+by/';
$pattern_php_runtime = '/Runtime:\s+PHP\s+([\d.]+)/'; $pattern_php_runtime = '/Runtime:\s+PHP\s+([\d.]+)/';
$pattern_configuration = '/Configuration:\s+(.+)/'; $pattern_configuration = '/Configuration:\s+(.+)/';
@ -314,7 +316,7 @@ function unittesting(){
$pattern_memory = '/Memory:\s+([\d.]+)\s+(MB|KB|GB)/'; $pattern_memory = '/Memory:\s+([\d.]+)\s+(MB|KB|GB)/';
$pattern_ok = '/OK\s+\((\d+)\s+test(?:s)?,\s+(\d+)\s+assertion(?:s)?\)/'; $pattern_ok = '/OK\s+\((\d+)\s+test(?:s)?,\s+(\d+)\s+assertion(?:s)?\)/';
$pattern_failures = '/Tests:\s+(\d+),\s+Assertions:\s+(\d+),\s+Failures:\s+(\d+)/'; $pattern_failures = '/Tests:\s+(\d+),\s+Assertions:\s+(\d+),\s+Failures:\s+(\d+)/';
// Perform matching
preg_match($pattern_phpunit_version, $text, $matches_phpunit_version); preg_match($pattern_phpunit_version, $text, $matches_phpunit_version);
preg_match($pattern_php_runtime, $text, $matches_php_runtime); preg_match($pattern_php_runtime, $text, $matches_php_runtime);
preg_match($pattern_configuration, $text, $matches_configuration); preg_match($pattern_configuration, $text, $matches_configuration);
@ -326,7 +328,7 @@ function unittesting(){
preg_match($pattern_memory, $text, $matches_memory); preg_match($pattern_memory, $text, $matches_memory);
preg_match($pattern_failures, $text, $matches_failures); preg_match($pattern_failures, $text, $matches_failures);
preg_match($pattern, $cleaned, $matches); preg_match($pattern, $cleaned, $matches);
// Extracted information
$phpunit_version = $matches_phpunit_version[1] ?? 'Not found'; $phpunit_version = $matches_phpunit_version[1] ?? 'Not found';
$phpunit_stat = isset($matches_ok[0]) ? $matches_ok[0] : "Not found"; $phpunit_stat = isset($matches_ok[0]) ? $matches_ok[0] : "Not found";
$phpunit_time = isset($matches_time[1]) ? $matches_time[1] : "Not found"; $phpunit_time = isset($matches_time[1]) ? $matches_time[1] : "Not found";
@ -368,7 +370,6 @@ function unittesting(){
$html2_lines = explode("\n", $html2); $html2_lines = explode("\n", $html2);
$result_content = str_replace(array("\r\n","\r"," "),"", $html1_lines); $result_content = str_replace(array("\r\n","\r"," "),"", $html1_lines);
$result_content2 = str_replace(array("\r\n","\r"," "),"", $html2_lines); $result_content2 = str_replace(array("\r\n","\r"," "),"", $html2_lines);
// Membandingkan setiap baris // Membandingkan setiap baris
for ($i = 0; $i < count($result_content) && $i < count($result_content2); $i++) { for ($i = 0; $i < count($result_content) && $i < count($result_content2); $i++) {
if ($result_content[$i] != $result_content2[$i]) { if ($result_content[$i] != $result_content2[$i]) {