public function testExecute_executesClosure() { $executed = false; $closure = function () use(&$executed) { $executed = true; }; $command = new ClosureCommand(); $command->setClosure($closure); $command->execute(); $this->assertTrue($executed, 'Closure should be executed'); }