App\Lib\Codeception::checkExecutable PHP Method

checkExecutable() public method

Check that the Codeception executable exists and is runnable.
public checkExecutable ( string $file, string $config ) : array
$file string File name of the Codeception executable.
$config string Full path of the config of where the $file was defined.
return array Array of flags used in the JSON respone.
    public function checkExecutable($file, $config)
    {
        $response = array();
        $response['resource'] = $file;
        // Set this to ensure the developer knows there $file was set.
        $response['config'] = realpath($config);
        if (!file_exists($file)) {
            $response['error'] = 'The Codeception executable could not be found.';
        } elseif (!is_executable($file) && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
            $response['error'] = 'Codeception isn\'t executable. Have you set executable rights to the following (try chmod o+x).';
        }
        // If there wasn't an error, then it's good!
        $response['ready'] = !isset($response['error']);
        return $response;
    }