- Added HVAC_Role_Manager class with role/permission management - Implemented test cases in HVAC_Role_Manager_Test.php - Created API documentation in docs/role-manager-api.md - Updated testing improvement plan with progress - Added design decisions to memory-bank/decisionLog.md Includes: - Role creation/deletion methods - Permission management system - Role conflict detection - Permission inheritance logic - Comprehensive test coverage
1.9 KiB
1.9 KiB
[2025-04-14 16:16:30] - Test Data Generation Pattern
- Implemented standardized test data generation via HVAC_Test_Data_Generator class
- Key features:
- Consistent data structure generation
- Override support for custom test scenarios
- Bulk generation capabilities
- Role-specific user creation
- Benefits:
- Reduced test setup code
- Consistent test data across test cases
- Easier maintenance of test data structures
- Improved test reliability
System Patterns
[2025-04-14 09:57:09] - Test Environment Pattern
-
Implements a robust test environment setup using HVAC_Test_Environment class
-
Key components:
-
Transaction Management
- Uses database transactions for test isolation
- Automatic rollback after each test
- Ensures clean state between tests
-
Plugin Verification
- Verifies TEC CE plugin activation
- Checks required plugin dependencies
- Fails fast if environment is not properly configured
-
Environment Reset
- Cleans up test data after each test
- Resets WordPress roles and capabilities
- Manages test user lifecycle
-
Base Test Case
- Extends WP_UnitTestCase for WordPress integration
- Provides helper methods for common test operations
- Handles test environment setup/teardown automatically
-
-
Benefits:
- Consistent test environment across all test cases
- Isolated tests with automatic cleanup
- Reduced test interference
- Simplified test case implementation
Command Execution Patterns
[2025-04-13 09:12:09] - Always use absolute paths when executing commands
- Commands should use full paths starting from root (e.g., /Users/ben/dev/...)
- This ensures consistency and reliability across different working directories
- Example: Use
/Users/ben/dev/upskill-event-manager/wordpress-dev/tests/e2e/login.spec.tsinstead oftests/e2e/login.spec.ts
Test Environment Setup
[Previous test environment setup patterns would be here...]