upskill-event-manager/memory-bank/systemPatterns.md
bengizmo cade20aa2b feat(testing): Implement HVAC Role Manager component
- 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
2025-04-14 19:02:22 -03:00

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:
    1. Consistent data structure generation
    2. Override support for custom test scenarios
    3. Bulk generation capabilities
    4. 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:

    1. Transaction Management

      • Uses database transactions for test isolation
      • Automatic rollback after each test
      • Ensures clean state between tests
    2. Plugin Verification

      • Verifies TEC CE plugin activation
      • Checks required plugin dependencies
      • Fails fast if environment is not properly configured
    3. Environment Reset

      • Cleans up test data after each test
      • Resets WordPress roles and capabilities
      • Manages test user lifecycle
    4. 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.ts instead of tests/e2e/login.spec.ts

Test Environment Setup

[Previous test environment setup patterns would be here...]