ApeMinTest.php in Advanced Page Expiration 8
File
src/Tests/ApeMinTest.php
View source
<?php
namespace Drupal\ape\Tests;
use Drupal\Tests\BrowserTestBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
class ApeMinTest extends BrowserTestBase {
protected $dumpHeaders = TRUE;
protected $defaultTheme = 'stark';
protected static $modules = [
'ape',
'ape_test',
'system',
];
protected $strictConfigSchema = FALSE;
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', '')
->set('exclusions', '')
->set('lifetime.alternatives', 60)
->set('lifetime.301', 1800)
->set('lifetime.302', 600)
->set('lifetime.404', 3600)
->save();
}
public function testApeHeaders() {
$this
->drupalGet('user/register');
$this
->assertEqual($this
->drupalGetHeader('Cache-Control'), 'max-age=2592000, public', 'Global Cache-Control header set.');
}
}
Classes
Name |
Description |
ApeMinTest |
Test cache-control header is set correctly after minimal configuration. |