function DrupalUnitTestBaseTest::testEnableModulesTheme

Tests that theme() works right after loading a module.

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php, line 250
Contains Drupal\simpletest\Tests\DrupalUnitTestBaseTest.

Class

DrupalUnitTestBaseTest
Tests DrupalUnitTestBase functionality.

Namespace

Drupal\simpletest\Tests

Code

function testEnableModulesTheme() {
  $original_element = $element = array(
    '#type' => 'container',
    '#markup' => 'Foo',
    '#attributes' => array(),
  );
  $this
    ->enableModules(array(
    'system',
  ));

  // theme() throws an exception if modules are not loaded yet.
  $this
    ->assertTrue(drupal_render($element));
  $element = $original_element;
  $this
    ->disableModules(array(
    'entity_test',
  ));
  $this
    ->assertTrue(drupal_render($element));
}