EnginePhpTemplateTest.php 1.07 KB
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\system\Tests\Theme\EnginePhpTemplateTest.
6 7 8 9 10 11 12 13 14
 */

namespace Drupal\system\Tests\Theme;

use Drupal\simpletest\WebTestBase;

/**
 * Tests theme functions and templates with the PHPTemplate engine.
 */
15
class EnginePhpTemplateTest extends WebTestBase {
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array('theme_test');

  public static function getInfo() {
    return array(
      'name' => 'PHPTemplate Engine',
      'description' => 'Test theme functions with PHPTemplate.',
      'group' => 'Theme',
    );
  }

  function setUp() {
    parent::setUp();
    theme_enable(array('test_theme_phptemplate'));
  }

  /**
   * Ensures a theme's template is overrideable based on the 'template' filename.
   */
  function testTemplateOverride() {
41
    \Drupal::config('system.theme')
42 43 44
      ->set('default', 'test_theme_phptemplate')
      ->save();
    $this->drupalGet('theme-test/template-test');
45
    $this->assertText('Success: Template overridden with PHPTemplate theme.', 'Template overridden by PHPTemplate file.');
46 47 48
  }

}