You are here

function hook_acquia_connector_spi_test in Acquia Connector 8.2

Same name and namespace in other branches
  1. 8 acquia_connector.api.php \hook_acquia_connector_spi_test()
  2. 3.x acquia_connector.api.php \hook_acquia_connector_spi_test()

Include data to be sent to Acquia Insight as part of the SPI process.

This data will be stored on Acquia's servers in an unencrypted database, so be careful not to send sensitive information in any field. Multiple tests can also be added per callback provided that each test has a unique identifier.

Return value

array An array of user-contributed test data keyed by unique identifier.

  • (string) description: Detailed information regarding test, its impact, and other relevant details. Cannot exceed 1024 characters.
  • (string) solved_message: The message to display when the test has succeeded. Cannot exceed 1024 characters.
  • (string) failed_message: The message to display when the test has failed. Cannot exceed 1024 characters.
  • (boolean) solved: A flag indicating whether or not the test was successful.
  • (string) fix_details: Information on how to fix or resolve the test if failed. Cannot exceed 1024 characters.
  • (string) category: The category to place the test within. Must be either 'performance', 'security, or 'best_practices'.
  • (int) severity: The priority level of the custom test. Must be either 0, 1, 2, 4, 8, 16, 32, 64, or 128. Higher severities impact the Insight score proportionally.
4 invocations of hook_acquia_connector_spi_test()
AcquiaConnectorCommands::customTestValidate in src/Commands/AcquiaConnectorCommands.php
A command callback and drush wrapper for custom test validation.
acquia_connector_requirements in ./acquia_connector.install
Implements hook_requirements().
SpiController::testCollect in src/Controller/SpiController.php
Collects all user-contributed test results that pass validation.
TestStatusController::testStatus in src/Controller/TestStatusController.php
Determines status of user-contributed tests.

File

./acquia_connector.api.php, line 63
Hooks related to module.

Code

function hook_acquia_connector_spi_test() {
  return [
    'unique_example' => [
      'description' => 'This example test is useful.',
      'solved_message' => 'The test was successful',
      'failed_message' => 'The test has failed',
      'solved' => TRUE,
      'fix_details' => 'Please resolve this issue using this fix information.',
      'category' => 'best_practices',
      'severity' => 0,
    ],
  ];
}