upskill-event-manager/wordpress-dev/tests/basic/smoke-test-detailed.php
bengizmo d6211ee364 feat(testing): Implement HVAC_Test_User_Factory and update .gitignore
- Add HVAC_Test_User_Factory class with:
  * User creation with specific roles
  * Multiple role support
  * Persona management system
  * Account cleanup integration
- Create comprehensive test suite in HVAC_Test_User_Factory_Test.php
- Update testing improvement plan documentation
- Add implementation decisions to project memory bank
- Restructure .gitignore with:
  * Whitelist approach for better file management
  * Explicit backup exclusions
  * Specific bin directory inclusions

Part of the Account Management component from the testing framework improvement plan.
2025-04-14 17:41:36 -03:00

61 lines
No EOL
2.4 KiB
PHP

<?php
/**
* Detailed smoke test with enhanced logging
*/
$log_file = __DIR__.'/smoke-test-detailed.log';
file_put_contents($log_file, "=== Starting detailed smoke test ===\n", FILE_APPEND);
try {
// 1. Verify test doubles exist
file_put_contents($log_file, "1. Checking test doubles file...\n", FILE_APPEND);
if (!file_exists(__DIR__.'/test-doubles.php')) {
throw new Exception("test-doubles.php not found");
}
file_put_contents($log_file, "✓ test-doubles.php exists\n", FILE_APPEND);
// 2. Load test doubles first
file_put_contents($log_file, "2. Loading test doubles...\n", FILE_APPEND);
require_once __DIR__.'/test-doubles.php';
file_put_contents($log_file, "✓ test doubles loaded\n", FILE_APPEND);
// 3. Verify plugin file exists
file_put_contents($log_file, "3. Checking plugin file...\n", FILE_APPEND);
$plugin_file = dirname(dirname(__DIR__)) . '/hvac-community-events.php';
if (!file_exists($plugin_file)) {
throw new Exception("Plugin file not found at: $plugin_file");
}
file_put_contents($log_file, "✓ plugin file exists\n", FILE_APPEND);
// 4. Load plugin
file_put_contents($log_file, "4. Loading plugin...\n", FILE_APPEND);
require_once $plugin_file;
file_put_contents($log_file, "✓ plugin loaded\n", FILE_APPEND);
// 5. Verify plugin class
file_put_contents($log_file, "5. Checking plugin class...\n", FILE_APPEND);
if (!class_exists('HVAC_Community_Events')) {
throw new Exception("Plugin class not loaded");
}
file_put_contents($log_file, "✓ plugin class exists\n", FILE_APPEND);
// 6. Verify version constant
file_put_contents($log_file, "6. Checking version constant...\n", FILE_APPEND);
if (!defined('HVAC_CE_VERSION')) {
throw new Exception("Version constant not defined");
}
file_put_contents($log_file, "✓ version constant exists\n", FILE_APPEND);
// 7. Verify TEC functions
file_put_contents($log_file, "7. Checking TEC functions...\n", FILE_APPEND);
if (!function_exists('tribe_get_events')) {
throw new Exception("TEC functions not available");
}
file_put_contents($log_file, "✓ TEC functions available\n", FILE_APPEND);
file_put_contents($log_file, "PASS: All checks completed successfully\n", FILE_APPEND);
exit(0);
} catch (Exception $e) {
file_put_contents($log_file, "FAIL: " . $e->getMessage() . "\n", FILE_APPEND);
exit(1);
}