/** * Helper function to handle a state method. * * @param string $handle * @param array $args * * @return mixed|void */ public function handle($handle, $args = []) { return $this->machine->handle($handle, $args); }
function it_should_call_a_handler(Machine $machine) { $machine->handle('handler', ['arg1' => 'argVal'])->shouldBeCalled()->willReturn("it worked"); $this->setMachine($machine); $this->handle('handler', ['arg1' => 'argVal'])->shouldReturn("it worked"); }
/** * @Given /^I run handle (.*)$/ */ public function iRunHandle($handle) { $this->fsm->handle($handle); }