public function testInvokeFlow() { $func = function () use(&$called) { $called = true; return true; }; $flow = Flow::map($func); $node = m::mock(NodeCollectionInterface::class); $node->shouldReceive('map')->with($func)->andReturn([]); $response = call_user_func($flow, $node); static::assertNotSame($response, $node); static::assertInstanceOf(NodeCollectionInterface::class, $response); }