What problem does it solve?
Provide deterministic, controllable test doubles for ColdBox TestBox specs so unit tests can isolate systems under test, simulate database queries, and assert interactions without hitting real external services.
Core Features & Use Cases
- Full, empty, and partial mocks via createMock, createEmptyMock, and prepareMock to replace collaborators and drive specific behaviors.
- Argument-specific stubbing with $args and $results, exception simulation with $throws, query simulation with querySim, property injection with $property, and spying on real methods with $spy for behavioral verification.
- Call logging and verification helpers ($once, $never, $times, $count, $callLog) to assert invocation counts and inspect arguments in service, DAO, and email-sending scenarios.
Quick Start
Prepare a mock for UserService that stubs save to return an object with id 1 and assert that save was called once.