css_cache.test in Chaos Tool Suite (ctools) 7
File
tests/css_cache.test
View source
<?php
class CtoolsCSSObjectCache extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'CSS cache',
'description' => 'Tests the custom CSS cache handler.',
'group' => 'ctools',
'dependencies' => array(
'ctools',
),
);
}
public function setUp(array $modules = array()) {
$modules[] = 'ctools';
parent::setUp($modules);
}
public function testCssCache() {
$filename = ctools_css_cache('body { color: red; }');
$this
->cronRun();
$this
->assertTrue(file_exists($filename), 'The CSS cache is not cleared after performing a cron run.');
drupal_flush_all_caches();
$this
->assertFalse(file_exists($filename), 'The CSS cache is cleared after clearing all caches.');
}
}