You are here

public function HoneypotCssTestCase::testHoneypotCssNonpublicFileSystem in Honeypot 7

Test CSS works when default file scheme is not public://

File

./honeypot.test, line 389
Testing for Honeypot module.

Class

HoneypotCssTestCase
Test Honeypot's CSS generation routines.

Code

public function testHoneypotCssNonpublicFileSystem() {
  variable_set('file_default_scheme', 'private');
  $honeypot_css = honeypot_get_css_file_path();

  // Delete the Honeypot CSS file (if it exists).
  file_unmanaged_delete($honeypot_css);

  // Make sure the Honeypot CSS file doesn't exist.
  $this
    ->assertFalse(file_exists($honeypot_css));

  // Run cron.
  honeypot_cron();

  // Make sure the Honeypot CSS file exists.
  $this
    ->assertTrue(file_exists($honeypot_css));
}