phpstreams\tests\unit\FunctionsTest::testCombine PHP Method

testCombine() public method

Test the Functions::combine method.
public testCombine ( )
    public function testCombine()
    {
        $a = function ($value) {
            return $value + 2;
        };
        $b = function ($value) {
            return $value * 3;
        };
        $result = Functions::combine($a, $b);
        $this->assertTrue(is_callable($result), 'Combined function should be callable.');
        $this->assertEquals($result(3), 15);
    }