You are here

public function EntityPrintTest::testEntityPrintThemeCss in Entity Print 7

Test that CSS is parsed from our test theme correctly.

File

tests/entity_print.test, line 47
Entity print tests.

Class

EntityPrintTest
@file Entity print tests.

Code

public function testEntityPrintThemeCss() {
  $account = $this
    ->drupalCreateUser(array(
    'bypass entity print access',
    'access content',
  ));
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('entityprint/node/' . $this->node->nid . '/debug');

  // Test the global CSS is there.
  $this
    ->assertRaw('entity-print.css');

  // Disable the global CSS and test it is not there.
  variable_set('entity_print_default_css', FALSE);
  $this
    ->drupalGet($this
    ->getUrl());
  $this
    ->assertNoRaw('entity-print.css');

  // Assert that the css files have been parsed out of our test theme.
  $this
    ->assertRaw('entityprint-all.css');
  $this
    ->assertRaw('entityprint-page.css');
  $this
    ->assertRaw('entityprint-node.css');

  // Test that CSS was added from hook_entity_print_css(). See the
  // entity_print_test module for the implementation.
  $this
    ->assertRaw('entityprint-module.css');
}