Codeception\Module\WPCLITest::it_should_allow_defining_a_split_callback_function PHP Method

it_should_allow_defining_a_split_callback_function() public method

    public function it_should_allow_defining_a_split_callback_function()
    {
        $this->executor->execAndOutput(Argument::type('string'), Argument::any())->willReturn('23 12');
        $expected = [1, 2, 3];
        $splitCallback = function () use($expected) {
            return $expected;
        };
        $sut = $this->make_instance();
        $ids = $sut->cliToArray('post list --format==ids', $splitCallback);
        $this->assertEquals($expected, $ids);
    }