You are here

public function ApeTest::initConfig in Advanced Page Expiration 8

Initialize various configurations post-installation.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container.

Overrides FunctionalTestSetupTrait::initConfig

File

src/Tests/ApeTest.php, line 38
Contains \Drupal\ape\Tests\ApeTest.

Class

ApeTest
Test cache-control header is set correctly after configuration.

Namespace

Drupal\ape\Tests

Code

public function initConfig(ContainerInterface $container) {
  parent::initConfig($container);
  $config = $container
    ->get('config.factory');
  $config
    ->getEditable('system.performance')
    ->set('cache.page.max_age', 2592000)
    ->save();
  $config
    ->getEditable('ape.settings')
    ->set('alternatives', '/ape_alternative')
    ->set('exclusions', '/ape_exclude')
    ->set('lifetime.alternatives', 60)
    ->set('lifetime.301', 1800)
    ->set('lifetime.302', 600)
    ->set('lifetime.404', 3600)
    ->save();
}