geolocation-8.x-3.x-dev/tests/modules/geolocation_test_views/geolocation_test_views.install
tests/modules/geolocation_test_views/geolocation_test_views.install
<?php
/**
* @file
* Geolocation test setup.
*/
/**
* Implements hook_install().
*/
function geolocation_test_views_install(): void {
/** @var \Drupal\Core\Config\Config $config */
$config = \Drupal::service('config.factory')->getEditable('geolocation_google_maps.settings');
if (empty($config->get('google_map_api_key'))) {
$config->set('google_map_api_key', 'AIzaSyAS0hYgEXBmvArc7_yXiK9lDrZ1O038weU')->save();
}
}
/**
* Implements hook_uninstall().
*/
function geolocation_test_views_uninstall(): void {
/** @var \Drupal\Core\Config\Config $config */
$config = \Drupal::service('config.factory')->getEditable('geolocation_google_maps.settings');
if ($config->get('google_map_api_key') == 'AIzaSyAS0hYgEXBmvArc7_yXiK9lDrZ1O038weU') {
$config->set('google_map_api_key', '')->save();
}
}
