Project

General

Profile

Revision b0dc3a2e

Added by Julien Enselme over 7 years ago

Update to Drupal 7.52

View differences:

drupal7/modules/simpletest/tests/common.test
947 947

  
948 948
    // Verify that invalid characters (including non-breaking space) are stripped from the identifier.
949 949
    $this->assertIdentical(drupal_clean_css_identifier('invalid !"#$%&\'()*+,./:;<=>?@[\\]^`{|}~ identifier', array()), 'invalididentifier', 'Strip invalid characters.');
950

  
951
    // Verify that double underscores are replaced in the identifier by default.
952
    $identifier = 'css__identifier__with__double__underscores';
953
    $expected = 'css--identifier--with--double--underscores';
954
    $this->assertIdentical(drupal_clean_css_identifier($identifier), $expected, 'Verify double underscores are replaced with double hyphens by default.');
955

  
956
    // Verify that double underscores are preserved in the identifier if the
957
    // variable allow_css_double_underscores is set to TRUE.
958
    $this->setAllowCSSDoubleUnderscores(TRUE);
959
    $this->assertIdentical(drupal_clean_css_identifier($identifier), $identifier, 'Verify double underscores are preserved if the allow_css_double_underscores set to TRUE.');
960

  
961
    // To avoid affecting other test cases, set the variable
962
    // allow_css_double_underscores to FALSE which is the default value.
963
    $this->setAllowCSSDoubleUnderscores(FALSE);
964
  }
965

  
966
  /**
967
   * Set the variable allow_css_double_underscores and reset the cache.
968
   *
969
   * @param $value bool
970
   *   A new value to be set to allow_css_double_underscores.
971
   */
972
  function setAllowCSSDoubleUnderscores($value) {
973
    $GLOBALS['conf']['allow_css_double_underscores'] = $value;
974
    drupal_static_reset('drupal_clean_css_identifier:allow_css_double_underscores');
950 975
  }
951 976

  
952 977
  /**
......
1254 1279
  function testRegions() {
1255 1280
    global $theme_key;
1256 1281

  
1257
    $block_regions = array_keys(system_region_list($theme_key));
1282
    $block_regions = system_region_list($theme_key, REGIONS_ALL, FALSE);
1258 1283
    $delimiter = $this->randomName(32);
1259 1284
    $values = array();
1260 1285
    // Set some random content for each region available.

Also available in: Unified diff