summaryrefslogtreecommitdiffstats
path: root/core/modules/config/lib/Drupal/config/Tests/LocaleConfigOverride.php
blob: 350a166af9ebf4b05c4cfb46064a3647861db45b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
41
42
<?php

/**
 * @file
 * Definition of Drupal\config\Tests\LocaleConfigOverride.
 */

namespace Drupal\config\Tests;

use Drupal\simpletest\WebTestBase;

/**
 * Tests locale config override.
 */
class LocaleConfigOverride extends WebTestBase {

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

  public static function getInfo() {
    return array(
      'name' => 'Locale override',
      'description' => 'Confirm that locale overrides work',
      'group' => 'Configuration',
    );
  }

  function testLocaleConfigOverride() {
    $name = 'config_test.system';
    // Verify the default configuration values exist.
    $config = config($name);
    $this->assertIdentical($config->get('foo'), 'bar');
    // Spoof multilingual.
    $GLOBALS['conf']['language_count'] = 2;
    drupal_language_initialize();
    $this->assertIdentical($config->get('foo'), 'en bar');
  }
}