How to skip codeception unit test?

codeception phpunit testing

There are cases where unit test need to be skipped, most likely because current test environment lacks some feature or library. The codeception library is built on top of phpunit, so to skip test there is a function markTestSkipped. Every code after this function will not be executed. It is good to add message explaining why test was skipped. Skipped tests will be marked with capital letter S.

Example use of test skipping

public function testValidationOfUpdatableParameter()
{
        $assertionExceptions = ini_get('assert.exception');
        if(!$assertionExceptions)
        {
                $this->markTestSkipped("PHP option `assert.exception` must be enabled for this test");
        }
}

Mark test as incomplete

There is also similar method named markTestIncomplete which works very similar to markTestSkipped, except that it is reported in test results with capital letter I.