4 * Tests the custom CSS cache handler.
8 * Tests the custom CSS cache handler.
10 class CtoolsObjectCache extends DrupalWebTestCase {
15 public static function getInfo() {
17 'name' => 'Ctools CSS cache',
18 'description' => 'Tests the custom CSS cache handler.',
19 'group' => 'Chaos Tools Suite',
26 public function setUp() {
27 parent::setUp('ctools');
31 * Tests the custom CSS cache handler.
33 * @see https://drupal.org/node/1313368
35 public function testCssCache() {
36 // Create a CSS cache entry.
37 $filename = ctools_css_cache('body { color: red; }');
39 // Perform a cron run. The CSS cache entry should not be removed.
41 $this->assertTrue(file_exists($filename), 'The CSS cache is not cleared after performing a cron run.');
43 // Manually clear the caches. The CSS cache entry should be removed.
44 drupal_flush_all_caches();
45 $this->assertFalse(file_exists($filename), 'The CSS cache is cleared after clearing all caches.');