How carlosas/phpat works
Main Components
a) Core Components:
• Test Runner System
• Rule Engine
• Parser System
• Assertion System
• Selector System
b) Supporting Components:
• Configuration Handler
• Statement Builder
• Test Builder
• Extractor System
Component Relationships and Structure
┌─────────────────────────────────────────────────────────┐
• Test Runner (PHPat) │
• ┬─────────────────────────┘
┌───────────────────────────────▼─────────────────────────┐
• Rule Engine & Validator │
• ┬─────────────┬────────────────────┬────┤
• Declaration │ Relation │ Statement │ │
• Rules │ Rules │ Builder │ │
• ┴─────────────┴────────────────────┘ │
┌─────────────────────────────────────────────────────┐ │
• Assertion System │ │
• ┬─────────────────────────────┤ │
• Declaration │ Relation │ │
• Assertions │ Assertions │ │
• ┴─────────────────────────────┘ │
┌─────────────────────────────────────────────────────┐ │
• Selector System │ │
• ┤ │
• Class/Interface/Trait/Enum Selectors │ │
• ┘ │
┌─────────────────────────────────────────────────────┐ │
• Parser System │ │
• ┘ │
┌─────────────────────────────────────────────────────┐ │
• Extractor System ◄───┘
• ┘
Key Elements to Highlight
a) Input/Output Flow:
• Test definitions input
• Configuration input
• Rule validation results output
• Error reporting output
b) Internal Processes:
• Test parsing and validation
• Rule execution flow
• Assertion verification
• Selector matching
Implementation Details
• Relationship between Rule, Assertion, and Selector components
• Separation between Declaration and Relation rules
• Extensibility points for custom rules
• Configuration integration points