Phalcon\Test\UnitTestCase::checkExtension PHP Method

checkExtension() public method

Checks if a particular extension is loaded and if not it marks the tests skipped
public checkExtension ( mixed $extension )
$extension mixed
    public function checkExtension($extension)
    {
        $message = function ($ext) {
            sprintf('Warning: %s extension is not loaded', $ext);
        };
        if (is_array($extension)) {
            foreach ($extension as $ext) {
                if (!extension_loaded($ext)) {
                    $this->markTestSkipped($message($ext));
                    break;
                }
            }
        } elseif (!extension_loaded($extension)) {
            $this->markTestSkipped($message($extension));
        }
    }