<?php
// Test cart API
require 'includes/middleware.php';
require 'config/database.php';

try {
    // Simulate a GET request to cart API
    $ch = curl_init('http://localhost/lms/api/cart.php');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    echo "HTTP Status: $httpCode\n";
    echo "Response: $response\n";
} catch(Exception $e) {
    echo 'API test failed: ' . $e->getMessage();
}
?>