File manager - Edit - /home/webapp69.cm.in.th/u69319090028/Shop/scratch/run_full_system_verification.php
Back
<?php /** * ============================================================================ * CARGOO MULTI-VENDOR MARKETPLACE - COMPREHENSIVE END-TO-END VERIFICATION SUITE * Verifies all 16 Modules from Prompt 01 to 16 * ============================================================================ */ require_once __DIR__ . '/../database/Database.php'; // Helpers require_once __DIR__ . '/../app/Helpers/Security.php'; require_once __DIR__ . '/../app/Helpers/Logger.php'; require_once __DIR__ . '/../app/Helpers/Session.php'; require_once __DIR__ . '/../app/Helpers/Url.php'; require_once __DIR__ . '/../app/Helpers/Language.php'; require_once __DIR__ . '/../app/Helpers/Auth.php'; require_once __DIR__ . '/../app/Helpers/AuthGuard.php'; require_once __DIR__ . '/../app/Helpers/DB.php'; require_once __DIR__ . '/../app/Helpers/Validator.php'; // Core require_once __DIR__ . '/../app/Core/Router.php'; require_once __DIR__ . '/../app/Core/Controller.php'; require_once __DIR__ . '/../app/Core/Model.php'; require_once __DIR__ . '/../app/Core/ErrorHandler.php'; // Services require_once __DIR__ . '/../app/Services/AuthService.php'; require_once __DIR__ . '/../app/Services/CartService.php'; require_once __DIR__ . '/../app/Services/StoreService.php'; require_once __DIR__ . '/../app/Services/SellerProductService.php'; require_once __DIR__ . '/../app/Services/SellerOrderService.php'; require_once __DIR__ . '/../app/Services/SellerInventoryService.php'; require_once __DIR__ . '/../app/Services/SellerFinanceService.php'; require_once __DIR__ . '/../app/Services/AnnouncementService.php'; require_once __DIR__ . '/../app/Services/PolicyService.php'; require_once __DIR__ . '/../app/Services/AdminPermissionService.php'; require_once __DIR__ . '/../app/Services/AdminUserService.php'; require_once __DIR__ . '/../app/Services/AdminSellerService.php'; require_once __DIR__ . '/../app/Services/AdminProductService.php'; require_once __DIR__ . '/../app/Services/AdminCategoryService.php'; require_once __DIR__ . '/../app/Services/AdminOrderService.php'; require_once __DIR__ . '/../app/Services/AdminReportService.php'; require_once __DIR__ . '/../app/Services/AdminDashboardService.php'; require_once __DIR__ . '/../app/Services/PlatformSettingService.php'; require_once __DIR__ . '/../app/Services/PaymentService.php'; require_once __DIR__ . '/../app/Services/PaymentAccountService.php'; require_once __DIR__ . '/../app/Services/RefundService.php'; require_once __DIR__ . '/../app/Services/ReviewService.php'; require_once __DIR__ . '/../app/Services/AdminReviewService.php'; require_once __DIR__ . '/../app/Services/NotificationService.php'; require_once __DIR__ . '/../app/Services/Security/RateLimiter.php'; require_once __DIR__ . '/../app/Services/Security/SecureUploadService.php'; // Models require_once __DIR__ . '/../app/Models/User.php'; require_once __DIR__ . '/../app/Models/Store.php'; require_once __DIR__ . '/../app/Models/Product.php'; require_once __DIR__ . '/../app/Models/Order.php'; require_once __DIR__ . '/../app/Models/Payment.php'; require_once __DIR__ . '/../app/Models/PaymentAttempt.php'; require_once __DIR__ . '/../app/Models/PaymentAccount.php'; require_once __DIR__ . '/../app/Models/Refund.php'; require_once __DIR__ . '/../app/Models/Review.php'; require_once __DIR__ . '/../app/Models/ReviewImage.php'; require_once __DIR__ . '/../app/Models/Notification.php'; require_once __DIR__ . '/../app/Models/Report.php'; require_once __DIR__ . '/../app/Models/AdminAuditLog.php'; require_once __DIR__ . '/../app/Models/PlatformSetting.php'; // Init session Session::start(); Language::init(); $db = Database::getInstance(); $totalPassed = 0; $totalFailed = 0; $suitesPassed = 0; $suitesFailed = 0; function runSuite(string $title, callable $testFunc) { global $suitesPassed, $suitesFailed, $totalPassed, $totalFailed; echo PHP_EOL . "============================================================" . PHP_EOL; echo "SUITE: {$title}" . PHP_EOL; echo "============================================================" . PHP_EOL; try { $suitePass = true; $testFunc(function($assertion, $name) use (&$totalPassed, &$totalFailed, &$suitePass) { if ($assertion) { echo " [PASS] {$name}" . PHP_EOL; $totalPassed++; } else { echo " [FAIL] {$name}" . PHP_EOL; $totalFailed++; $suitePass = false; } }); if ($suitePass) { $suitesPassed++; echo "--> SUITE RESULT: PASSED" . PHP_EOL; } else { $suitesFailed++; echo "--> SUITE RESULT: FAILED" . PHP_EOL; } } catch (Throwable $e) { $suitesFailed++; $totalFailed++; echo " [EXCEPTION] {$e->getMessage()}" . PHP_EOL; echo " In {$e->getFile()}:{$e->getLine()}" . PHP_EOL; echo "--> SUITE RESULT: FAILED WITH EXCEPTION" . PHP_EOL; } } // ── TEMPORARY TEST FIXTURES ────────────────────────────────────────── $tempSellerEmail = 'temp_seller_' . time() . '@cargoo.local'; $db->query("INSERT INTO users (username, email, phone, password, first_name, last_name, status, is_super_admin, created_at, updated_at) VALUES ('temp_seller_" . time() . "', '{$tempSellerEmail}', '089" . rand(1000000, 9999999) . "', 'hash', 'Test', 'Seller', 'active', 0, NOW(), NOW())"); $tempSellerId = (int)$db->lastInsertId(); $tempStoreSlug = 'temp-verif-store-' . time(); $db->query("INSERT INTO stores (user_id, store_name, store_slug, description, status, verified_at, created_at, updated_at) VALUES ({$tempSellerId}, 'Verification Test Store', '{$tempStoreSlug}', 'Temp Store', 'active', NOW(), NOW(), NOW())"); $tempStoreId = (int)$db->lastInsertId(); $tempProdSlug = 'temp-verif-prod-' . time(); $db->query("INSERT INTO products (store_id, seller_id, category_id, name, slug, description, price, original_price, stock, status, created_at, updated_at) VALUES ({$tempStoreId}, {$tempSellerId}, 1, 'Verification Test Product', '{$tempProdSlug}', 'Temp Product', 500.00, 700.00, 50, 'active', NOW(), NOW())"); $tempProdId = (int)$db->lastInsertId(); // ── 1. DATABASE SCHEMA & INTEGRITY ────────────────────────────────── runSuite("1. Database Schema & Critical Tables Audit", function($test) use ($db) { $requiredTables = [ 'users', 'roles', 'user_roles', 'user_sessions', 'login_history', 'login_attempts', 'user_addresses', 'stores', 'categories', 'products', 'product_skus', 'product_images', 'product_variations', 'product_variation_options', 'carts', 'cart_items', 'orders', 'order_items', 'payments', 'payment_attempts', 'payment_slips', 'payment_accounts', 'refunds', 'reviews', 'review_images', 'settlements', 'announcements', 'user_agreements', 'user_agreement_acceptances', 'notifications', 'reports', 'admin_audit_logs', 'admin_permissions', 'platform_settings', 'rate_limits' ]; $existingTables = $db->query("SHOW TABLES")->fetchAll(PDO::FETCH_COLUMN); foreach ($requiredTables as $tbl) { $test(in_array($tbl, $existingTables, true), "Table exists: `{$tbl}`"); } // Verify rating columns on products & stores $prodCols = $db->query("DESCRIBE products")->fetchAll(PDO::FETCH_COLUMN); $test(in_array('rating_avg', $prodCols, true), "Column `products.rating_avg` exists"); $test(in_array('rating_count', $prodCols, true), "Column `products.rating_count` exists"); $storeCols = $db->query("DESCRIBE stores")->fetchAll(PDO::FETCH_COLUMN); $test(in_array('rating_avg', $storeCols, true), "Column `stores.rating_avg` exists"); $test(in_array('rating_count', $storeCols, true), "Column `stores.rating_count` exists"); }); // ── 2. MULTI-ROLE AUTHENTICATION & SECURITY ───────────────────────── runSuite("2. Multi-Role Authentication & Session Security", function($test) use ($db) { $authService = new AuthService(); $userModel = new User(); // 2.1 Password hashing & verification $rawPassword = 'SecurePassword!999'; $hash = Security::hashPassword($rawPassword); $test(Security::verifyPassword($rawPassword, $hash), "Security::hashPassword / verifyPassword works"); // 2.2 Register unique customer $uniqueSuffix = time() . '_' . rand(100, 999); $username = "cust_{$uniqueSuffix}"; $email = "cust_{$uniqueSuffix}@cargoo.local"; $registerResult = $authService->register([ 'username' => $username, 'email' => $email, 'password' => $rawPassword, 'confirm_password' => $rawPassword, 'first_name' => 'Test', 'last_name' => 'Customer', 'phone' => '081' . rand(1000000, 9999999), 'terms_accepted' => '1' ]); $test($registerResult['success'] === true, "Customer registration succeeds"); $testUserId = (int)($registerResult['user_id'] ?? 0); // 2.3 Verify role assignment $roles = $userModel->getUserRoles($testUserId); $test(in_array('customer', $roles, true), "User assigned 'customer' role by default"); // 2.4 Login verification via authenticate() $authResult = $authService->authenticate($username, $rawPassword, false); $test($authResult['success'] === true, "Customer authenticate with valid credentials succeeds"); // 2.5 Failed Login Rate Limiting $fakeKey = "login:fake_user_{$uniqueSuffix}"; RateLimiter::clear($fakeKey); for ($i = 0; $i < 5; $i++) { RateLimiter::hit($fakeKey, 60); } $test(RateLimiter::tooManyAttempts($fakeKey, 5) === true, "Brute force login rate limiter blocks after 5 attempts"); RateLimiter::clear($fakeKey); // Cleanup test user $db->query("DELETE FROM user_roles WHERE user_id = {$testUserId}"); $db->query("DELETE FROM user_agreement_acceptances WHERE user_id = {$testUserId}"); $db->query("DELETE FROM users WHERE id = {$testUserId}"); }); // ── 3. CATALOG & PRODUCT BROWSING ─────────────────────────────────── runSuite("3. Catalog, Product Search & Category Tree", function($test) use ($db) { $productModel = new Product(); // Check active categories $cats = $db->query("SELECT id, name, slug FROM categories WHERE status = 'active' LIMIT 5")->fetchAll(); $test(!empty($cats), "Active product categories exist in database"); // Check active products $products = $db->query("SELECT id, name, price, status FROM products WHERE status = 'active' LIMIT 5")->fetchAll(); $test(!empty($products), "Active products available for catalog search"); if (!empty($products)) { $firstProd = $products[0]; $detail = $productModel->findById((int)$firstProd['id']); $test($detail !== null, "Product details accessible by ID"); $test(isset($detail['price']) && (float)$detail['price'] > 0, "Product has valid numeric price"); } }); // ── 4. SHOPPING CART OPERATIONS ───────────────────────────────────── runSuite("4. Shopping Cart Subtotals & Constraints", function($test) use ($db) { $cartService = new CartService(); $product = $db->query("SELECT id, price, store_id FROM products WHERE status = 'active' LIMIT 1")->fetch(); $user = $db->query("SELECT id FROM users LIMIT 1")->fetch(); if ($product && $user) { $testUserId = (int)$user['id']; $prodId = (int)$product['id']; // Add to cart $addRes = $cartService->addItem($testUserId, $prodId, 2); $test($addRes['success'] === true, "Item added to customer cart"); $cart = $cartService->getCart($testUserId); $test(!empty($cart['stores']), "Cart stores and items retrievable"); $test((float)$cart['grand_total'] > 0, "Cart grand total calculated correctly"); // Clear cart $cartId = (int)$cart['cart_id']; $db->query("DELETE FROM cart_items WHERE cart_id = {$cartId}"); $clearedCart = $cartService->getCart($testUserId); $test(empty($clearedCart['stores']), "Cart cleared cleanly"); } }); // ── 5. MULTI-VENDOR CHECKOUT & ORDER SPLITTING ────────────────────── runSuite("5. Multi-Vendor Order Creation & Splitting", function($test) use ($db) { $customer = $db->query("SELECT id FROM users ORDER BY id ASC LIMIT 1")->fetch(); $product = $db->query("SELECT id, store_id, name, price FROM products WHERE status = 'active' LIMIT 1")->fetch(); $customerId = (int)$customer['id']; $productId = (int)$product['id']; $storeId = (int)$product['store_id']; $price = (float)$product['price']; $orderNo = 'VERIF-ORD-' . time(); $db->query("INSERT INTO orders (order_no, customer_id, store_id, total_amount, order_status, payment_status, payment_method, created_at, updated_at) VALUES ('{$orderNo}', {$customerId}, {$storeId}, {$price}, 'pending', 'pending', 'PromptPay', NOW(), NOW())"); $orderId = (int)$db->lastInsertId(); $db->query("INSERT INTO order_items (order_id, product_id, product_name, unit_price, quantity, subtotal, created_at) VALUES ({$orderId}, {$productId}, '{$product['name']}', {$price}, 1, {$price}, NOW())"); $orderItemId = (int)$db->lastInsertId(); $test($orderId > 0, "Order #{$orderNo} created with unique Order No"); $test($orderItemId > 0, "Order items mapped to order successfully"); // Clean up $db->query("DELETE FROM order_items WHERE id = {$orderItemId}"); $db->query("DELETE FROM orders WHERE id = {$orderId}"); }); // ── 6. STOCK CONCURRENCY & ATOMIC DEDUCTION ───────────────────────── runSuite("6. Stock Concurrency & Atomic Operations", function($test) use ($db) { $prod = $db->query("SELECT id FROM products LIMIT 1")->fetch(); $prodId = $prod ? (int)$prod['id'] : 1; // Insert temporary test SKU $db->query("INSERT INTO product_skus (product_id, sku, variation_summary, price, stock, status, last_updated) VALUES ({$prodId}, 'TEST-SKU-CONCURRENCY', 'Standard', 100.00, 10, 'available', NOW())"); $skuId = (int)$db->lastInsertId(); // 6.1 Atomic Decrement with stock check $dec1 = DB::atomicDecrement('product_skus', 'stock', 4, "id = {$skuId}", [], true); $test($dec1 === true, "Atomic decrement of 4 units succeeds (10 -> 6)"); $checkStock = (int)$db->query("SELECT stock FROM product_skus WHERE id = {$skuId}")->fetchColumn(); $test($checkStock === 6, "Stock accurately reduced to 6"); // 6.2 Prevent negative balance / overselling $decTooMuch = DB::atomicDecrement('product_skus', 'stock', 10, "id = {$skuId}", [], true); $test($decTooMuch === false, "Atomic decrement prevented overselling when requested > available"); $checkStockAfter = (int)$db->query("SELECT stock FROM product_skus WHERE id = {$skuId}")->fetchColumn(); $test($checkStockAfter === 6, "Stock remains protected at 6 without corruption"); // 6.3 Atomic Increment / Restoration $inc = DB::atomicIncrement('product_skus', 'stock', 4, "id = {$skuId}"); $test($inc === true, "Atomic increment restores stock (6 -> 10)"); $db->query("DELETE FROM product_skus WHERE id = {$skuId}"); }); // ── 7. PAYMENT STATE MACHINE & VERIFICATION ───────────────────────── runSuite("7. Payment State Machine, Attempts & Verification", function($test) use ($db) { $paymentService = new PaymentService(); // Setup temporary order for payment test $orderNo = 'VERIF-PAY-' . time(); $db->query("INSERT INTO orders (order_no, customer_id, store_id, total_amount, order_status, payment_status, payment_method, created_at, updated_at) VALUES ('{$orderNo}', 1, 1, 500.00, 'pending', 'pending', 'PromptPay', NOW(), NOW())"); $orderId = (int)$db->lastInsertId(); // Initiate payment via initiatePayment() $payResult = $paymentService->initiatePayment($orderId, 'PromptPay', 1, 500.00); $test($payResult['success'] === true, "Payment initiated successfully"); $payment = $payResult['payment'] ?? []; $test($payment['payment_status'] === 'pending', "Initial payment status is 'pending'"); // Update to awaiting_verification $db->query("UPDATE payments SET payment_status = 'awaiting_verification' WHERE id = {$payment['id']}"); $updatedPay = $paymentService->getPaymentByOrderNo($orderNo, 1); $test($updatedPay['payment_status'] === 'awaiting_verification', "Payment status transitions to 'awaiting_verification' upon slip upload"); // Admin Verification -> Confirmed $db->query("UPDATE payments SET payment_status = 'confirmed', confirmed_at = NOW() WHERE id = {$payment['id']}"); $confirmedPay = $paymentService->getPaymentByOrderNo($orderNo, 1); $test($confirmedPay['payment_status'] === 'confirmed', "Payment status confirmed after Admin verification"); // Cleanup $db->query("DELETE FROM payment_attempts WHERE payment_id = {$payment['id']}"); $db->query("DELETE FROM payments WHERE id = {$payment['id']}"); $db->query("DELETE FROM orders WHERE id = {$orderId}"); }); // ── 8. COMMISSION & SETTLEMENT ENGINE ─────────────────────────────── runSuite("8. Commission Snapshot & Seller Settlement Engine", function($test) use ($db) { $financeService = new SellerFinanceService(); $store = $db->query("SELECT id, user_id FROM stores LIMIT 1")->fetch(); if ($store) { $userId = (int)$store['user_id']; $res = $financeService->getFinanceSummary($userId); $test(isset($res['summary']['gross_sales']), "Finance summary contains gross_sales"); $test(isset($res['summary']['total_commission']), "Finance summary contains total_commission"); $test(isset($res['summary']['net_revenue']), "Finance summary contains net_revenue"); $test((float)$res['summary']['net_revenue'] >= 0, "Net revenue is a valid non-negative number"); } }); // ── 9. REVIEW & RATING INTEGRITY ──────────────────────────────────── runSuite("9. Review Eligibility, Star Breakdown & Moderation", function($test) use ($db) { $reviewService = new ReviewService(); $reviewModel = new Review(); $adminReviewService = new AdminReviewService(); // Create completed order $orderNo = 'VERIF-REV-' . time(); $db->query("INSERT INTO orders (order_no, customer_id, store_id, total_amount, order_status, payment_status, payment_method, created_at, updated_at) VALUES ('{$orderNo}', 1, 1, 250.00, 'completed', 'confirmed', 'PromptPay', NOW(), NOW())"); $orderId = (int)$db->lastInsertId(); $product = $db->query("SELECT id, name FROM products LIMIT 1")->fetch(); $productId = (int)$product['id']; $db->query("INSERT INTO order_items (order_id, product_id, product_name, unit_price, quantity, subtotal, created_at) VALUES ({$orderId}, {$productId}, '{$product['name']}', 250.00, 1, 250.00, NOW())"); $orderItemId = (int)$db->lastInsertId(); // 9.1 Buyer eligibility check $elig = $reviewService->checkEligibility(1, $orderItemId); $test($elig['eligible'] === true, "Buyer of completed order item is eligible to review"); // 9.2 Non-buyer eligibility block $nonBuyerElig = $reviewService->checkEligibility(9999, $orderItemId); $test($nonBuyerElig['eligible'] === false, "Non-buyer is strictly blocked from reviewing"); // 9.3 Submit review & prevent duplicate $subRes = $reviewService->submitReview(1, $orderItemId, 5, 'สินค้าคุณภาพเยี่ยมมากครับ'); $test($subRes['success'] === true, "Review submitted successfully"); $revId = (int)$subRes['review_id']; $dupRes = $reviewService->submitReview(1, $orderItemId, 4, 'รีวิวซ้ำ'); $test($dupRes['success'] === false, "Duplicate review for same order item is blocked"); // 9.4 Rating aggregation breakdown $breakdown = $reviewModel->getProductRatingBreakdown($productId); $test($breakdown['total_reviews'] >= 1, "Product total reviews aggregated correctly"); $test($breakdown['avg_rating'] > 0, "Product average rating calculated dynamically"); // 9.5 Admin Moderation (Hide & Restore) $hide = $adminReviewService->moderateReview(1, $revId, 'hide', 'รอตรวจสอบ'); $test($hide['success'] === true, "Admin can hide inappropriate review"); $restore = $adminReviewService->moderateReview(1, $revId, 'restore', 'ผ่านเกณฑ์'); $test($restore['success'] === true, "Admin can restore review"); // Cleanup $db->query("DELETE FROM reviews WHERE id = {$revId}"); $db->query("DELETE FROM order_items WHERE id = {$orderItemId}"); $db->query("DELETE FROM orders WHERE id = {$orderId}"); $reviewModel->recalculateProductRating($productId); }); // ── 10. NOTIFICATION DISPATCH & COUNTERS ──────────────────────────── runSuite("10. Centralized In-App Notifications & Unread Badges", function($test) use ($db) { $notifService = new NotificationService(); $notifModel = new Notification(); $notifId = $notifService->notifyUser(1, 'order_status_changed', 'ออเดอร์พร้อมส่ง', 'สินค้าอยู่ระหว่างนำส่ง', 'order', 1, '/account/orders/1'); $test($notifId > 0, "In-app notification generated and persisted"); $unread = $notifService->getUnreadCount(1, 'customer'); $test($unread >= 1, "Unread count accurately reflects new notification"); $mark = $notifService->markAsRead($notifId, 1); $test($mark === true, "Mark as read transitions notification state"); $notifData = $notifModel->fetchOne("SELECT is_read, read_at FROM notifications WHERE id = :id", [':id' => $notifId]); $test((int)$notifData['is_read'] === 1 && !empty($notifData['read_at']), "is_read set to 1 with timestamp"); // Cleanup $db->query("DELETE FROM notifications WHERE id = {$notifId}"); }); // ── 11. ANNOUNCEMENTS & POLICIES ──────────────────────────────────── runSuite("11. Target Announcements & Versioned Policies", function($test) use ($db) { $annService = new AnnouncementService(); $polService = new PolicyService(); // Check active placements $announcements = $annService->getPlacements('global_top_bar', 'all'); $test(is_array($announcements), "Active announcements retrievable by placement"); // Check active policy $policy = $polService->getPolicy('customer'); $test($policy !== null, "Customer Agreement policy published and retrievable"); $test(!empty($policy['version']), "Policy has active version string"); }); // ── 12. SECURITY, RATE LIMITS & DATA SANITIZATION ─────────────────── runSuite("12. Web Security, Rate Limiter & Data Masking", function($test) { // Thai ID check $validId = '1100400874943'; $invalidId = '1100400874940'; $test(Validator::make(['id' => $validId], ['id' => 'thai_id'])->validate() === true, "Thai National ID Checksum validates valid ID"); $test(Validator::make(['id' => $invalidId], ['id' => 'thai_id'])->validate() === false, "Thai National ID Checksum rejects invalid ID"); // Rate Limiter $testKey = 'verif_key_' . time(); RateLimiter::clear($testKey); RateLimiter::hit($testKey, 60); RateLimiter::hit($testKey, 60); $test(RateLimiter::tooManyAttempts($testKey, 2) === true, "RateLimiter blocks when hits >= max attempts"); RateLimiter::clear($testKey); // Sensitive Logger Scrubbing $dirty = ['password' => 'secret', 'token' => 'jwt_token', 'user_id' => 5]; $clean = Logger::scrubSensitiveData($dirty); $test($clean['password'] === '********', "Password scrubbed in logger context"); $test($clean['token'] === '********', "Token scrubbed in logger context"); $test($clean['user_id'] === 5, "Safe context preserved"); }); // ── 13. ROUTE INTEGRITY & VIEW RESOLUTION ─────────────────────────── runSuite("13. Router Registration & Controller Action Mapping", function($test) { $indexPath = __DIR__ . '/../index.php'; $indexContent = file_get_contents($indexPath); // Check critical routes registered $criticalRoutes = [ "'/cart'", "'/checkout'", "'/payment/{order_no}'", "'/account/orders'", "'/account/reviews'", "'/account/notifications'", "'/seller'", "'/seller/products'", "'/seller/orders'", "'/seller/inventory'", "'/seller/finance'", "'/seller/reviews'", "'/admin'", "'/admin/users'", "'/admin/sellers'", "'/admin/products'", "'/admin/categories'", "'/admin/orders'", "'/admin/payments'", "'/admin/refunds'", "'/admin/finance'", "'/admin/reviews'", "'/admin/reports'", "'/admin/announcements'", "'/admin/policies'", "'/admin/admins'", "'/admin/settings'" ]; foreach ($criticalRoutes as $route) { $test(strpos($indexContent, $route) !== false, "Route registered: {$route}"); } }); // ── CLEANUP TEST FIXTURES ─────────────────────────────────────────── $db->query("DELETE FROM products WHERE id = {$tempProdId}"); $db->query("DELETE FROM stores WHERE id = {$tempStoreId}"); $db->query("DELETE FROM users WHERE id = {$tempSellerId}"); // ── SUMMARY REPORT ────────────────────────────────────────────────── echo PHP_EOL . "============================================================" . PHP_EOL; echo "CARGOO MARKETPLACE FINAL INTEGRATION & ACCEPTANCE SUMMARY" . PHP_EOL; echo "============================================================" . PHP_EOL; echo "Total Test Assertions: " . ($totalPassed + $totalFailed) . PHP_EOL; echo "Passed Assertions: {$totalPassed}" . PHP_EOL; echo "Failed Assertions: {$totalFailed}" . PHP_EOL; echo "Suites Passed: {$suitesPassed} / " . ($suitesPassed + $suitesFailed) . PHP_EOL; echo "============================================================" . PHP_EOL; if ($totalFailed === 0 && $suitesFailed === 0) { echo "🎉 ALL VERIFICATION SUITES PASSED! SYSTEM IS PRODUCTION READY! 🎉" . PHP_EOL; exit(0); } else { echo "❌ SOME VERIFICATION TESTS FAILED. PLEASE REVIEW LOGS. ❌" . PHP_EOL; exit(1); }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings