You are here

MailchimpConfigOverrider.php in Mailchimp 8

Same filename and directory in other branches
  1. 2.x tests/modules/mailchimp_test/src/MailchimpConfigOverrider.php

File

tests/modules/mailchimp_test/src/MailchimpConfigOverrider.php
View source
<?php

namespace Drupal\mailchimp_test;

use Drupal\Core\Config\ConfigCollectionInfo;
use Drupal\Core\Config\ConfigCrudEvent;
use Drupal\Core\Config\ConfigFactoryOverrideBase;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
use Drupal\Core\Config\ConfigRenameEvent;
use Drupal\Core\Config\StorageInterface;

/**
 * Tests module overrides for configuration.
 */
class MailchimpConfigOverrider extends ConfigFactoryOverrideBase implements ConfigFactoryOverrideInterface {

  /**
   * {@inheritdoc}
   */
  public function loadOverrides($names) {
    $overrides = [
      'mailchimp.settings' => [
        'api_key' => 'MAILCHIMP_TEST_API_KEY',
        'cron' => FALSE,
        'batch_limit' => 100,
        'test_mode' => TRUE,
      ],
    ];
    return $overrides;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheSuffix() {
    return 'mailchimp_test_cache';
  }

  /**
   * {@inheritdoc}
   */
  public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheableMetadata($name) {

    // Not required for test case config.
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function addCollections(ConfigCollectionInfo $collection_info) {

    // Not required for test case config.
  }

  /**
   * {@inheritdoc}
   */
  public function onConfigDelete(ConfigCrudEvent $event) {

    // Not required for test case config.
  }

  /**
   * {@inheritdoc}
   */
  public function onConfigRename(ConfigRenameEvent $event) {

    // Not required for test case config.
  }

  /**
   * {@inheritdoc}
   */
  public function onConfigSave(ConfigCrudEvent $event) {

    // Not required for test case config.
  }

}

Classes

Namesort descending Description
MailchimpConfigOverrider Tests module overrides for configuration.