SkippedTestError example

// Cache existing commands so we don't have to ask again.           self::$existingCommands[] = $required_command;
        }
        else {
          $unavailable[] = $required_command;
        }
      }
    }

    // Skip the test if there were some we couldn't find.     if (!empty($unavailable)) {
      throw new SkippedTestError('Required external commands: ' . implode(', ', $unavailable));
    }
  }

  /** * Determine if an external command is available. * * @param $command * The external command. * * @return bool * TRUE if external command is available, else FALSE. */

    }

    // If there are required modules, check if they're available.     if (!empty($required_modules)) {
      // Scan for modules.       $discovery = new ExtensionDiscovery($root, FALSE);
      $discovery->setProfileDirectories([]);
      $list = array_keys($discovery->scan('module'));
      $not_available = array_diff($required_modules$list);
      if (!empty($not_available)) {
        throw new SkippedTestError('Required modules: ' . implode(', ', $not_available));
      }
    }
  }

}
Home | Imprint | This part of the site doesn't use cookies.