public function testInstanceOf() { $flow = new Each(Flow::callback(function ($node) { return $node; })); static::assertInstanceOf(FlowInterface::class, $flow); }
public function testInvokeFlow() { $called = null; $return = m::mock(NodeInterface::class); $callbackFlow = Flow::callback(function ($item) use(&$called, $return) { $called = $item; return $return; }); $node = m::mock(NodeInterface::class); $output = call_user_func($callbackFlow, $node); static::assertEquals($return, $output); static::assertEquals($called, $node); }