countPublishedTheses(); echo "✓ Found {$count} published theses\n"; // Test getting theses $theses = $db->getPublishedTheses(5, 0); echo "✓ Retrieved " . count($theses) . " theses\n"; if (count($theses) > 0) { $first = $theses[0]; echo "\nFirst thesis:\n"; echo " ID: " . $first['id'] . "\n"; echo " Title: " . $first['title'] . "\n"; echo " Author(s): " . ($first['authors'] ?? 'N/A') . "\n"; echo " Year: " . $first['year'] . "\n"; // Test getting single thesis $thesis = $db->getThesisById($first['id']); if ($thesis) { echo "✓ Successfully retrieved thesis details\n"; echo " Orientation: " . ($thesis['orientation'] ?? 'N/A') . "\n"; echo " AP Program: " . ($thesis['ap_program'] ?? 'N/A') . "\n"; echo " Files: " . (count($thesis['files'] ?? [])) . "\n"; } } echo "\n✓ All tests passed!\n"; } catch (Exception $e) { echo "✗ Error: " . $e->getMessage() . "\n"; exit(1); }