Clinner\Command\Tests\CallbackTest::testGetExitCode PHP Method

testGetExitCode() public method

public testGetExitCode ( )
    public function testGetExitCode()
    {
        $closure = function ($a) {
            return 17;
        };
        $callback = new Callback($closure);
        // Exit code must be null before the command is run
        $this->assertNull($callback->getExitCode());
        $callback->run();
        // Exit code must be 17 after the command is run with the given $closure
        $this->assertEquals(17, $callback->getExitCode());
    }