PHPUnit: Test Closures with Mockery::spy
📰 Dev.to · Recca Tsai
Assertions inside a closure pass silently even if never called. Wrap the closure in Mockery::spy to verify invocation count and arguments in PHPUnit tests.
Assertions inside a closure pass silently even if never called. Wrap the closure in Mockery::spy to verify invocation count and arguments in PHPUnit tests.