# Test Environment Checklist

## Overview
This checklist provides a comprehensive guide for setting up and verifying the test environment for the HVAC Community Events plugin. It addresses common issues encountered during testing on the staging environment.

## Basic Test Environment (Implemented)
- [x] Created basic test directory structure
- [x] Implemented bootstrap.php for test initialization
- [x] Created test-doubles.php for TEC mocks
- [x] Implemented basic functionality test suite
- [x] Added test execution script
- [x] Created deployment scripts

## Environment Verification
### WordPress Core
- [ ] WordPress core files are present and accessible
- [ ] wp-config.php is properly configured
- [ ] WordPress version meets minimum requirements
- [ ] WordPress debug mode is enabled for testing

### Plugin Dependencies
- [ ] The Events Calendar plugin is installed and activated
- [ ] The Events Calendar Community Events plugin is installed and activated
- [ ] Event Tickets plugin is installed and activated (if needed)
- [ ] All required plugins meet minimum version requirements

### Database Configuration
- [ ] Database credentials are correct in wp-tests-config.php
- [ ] Database user has necessary permissions
- [ ] Table prefix is correctly configured

### Test Configuration Files
- [x] bootstrap.php exists and is properly configured
- [x] test-doubles.php provides necessary mock functions
- [x] Basic test suite implemented
- [x] Test runner script created

### Test Environment
- [ ] Composer dependencies are installed
- [ ] PHPUnit is available and executable
- [x] Test directories exist and are writable
- [x] Test results directory exists and is writable

## Staging Environment Setup
### Staging Access
- [x] SSH access is configured and working
- [x] Staging credentials are set in .env
- [x] File permissions allow plugin deployment
- [ ] Database access is configured with correct credentials

### Staging Testing Commands
```bash
# Deploy basic tests to staging
./wordpress-dev/bin/deploy-basic-tests.sh

# Run basic functionality tests
./wordpress-dev/bin/run-basic-tests.sh
```

## Common Issues and Solutions
### Missing TEC Classes/Functions
**Issue**: Tests fail with `Class "Tribe__Events__Main" not found`  
**Solution**: Implemented in test-doubles.php with mock classes and functions

### Database Access Issues
**Issue**: Cannot create or access test database  
**Solution**: Using existing database credentials from staging configuration

### Missing Methods
**Issue**: Tests fail with undefined method errors  
**Solution**: Essential methods mocked in test-doubles.php

### PHPUnit Configuration Issues
**Issue**: PHPUnit cannot find bootstrap file  
**Solution**: Direct path configuration in run-tests.php

## Test Environment Maintenance
### Regular Verification
- [ ] Run verification scripts weekly
- [ ] Update test dependencies when plugin dependencies are updated
- [ ] Document any environment-specific configurations

### Troubleshooting Process
1. Verify WordPress and plugin files exist and are accessible
2. Check database connection and credentials
3. Validate test configuration files
4. Review test logs for specific errors
5. Test with minimal configuration to isolate issues

## Next Steps
1. Deploy basic test suite to staging
2. Run initial tests and verify results
3. Address any configuration issues
4. Expand test coverage based on results
5. Document any staging-specific requirements