Projet

Général

Profil

Révision b0dc3a2e

Ajouté par Julien Enselme il y a plus de 7 ans

Update to Drupal 7.52

Voir les différences:

drupal7/modules/node/node.test
1518 1518
   * Tests editing a node type using the UI.
1519 1519
   */
1520 1520
  function testNodeTypeEditing() {
1521
    $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types'));
1521
    $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'administer fields'));
1522 1522
    $this->drupalLogin($web_user);
1523 1523

  
1524 1524
    $instance = field_info_instance('node', 'body', 'page');
......
2768 2768
    node_access_rebuild();
2769 2769

  
2770 2770
    // Create some users.
2771
    $this->admin_user = $this->drupalCreateUser(array('access content', 'bypass node access'));
2772
    $this->content_admin_user = $this->drupalCreateUser(array('access content', 'administer content types'));
2771
    $this->admin_user = $this->drupalCreateUser(array('access content', 'bypass node access', 'administer fields'));
2772
    $this->content_admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer fields'));
2773 2773

  
2774 2774
    // Add a custom field to the page content type.
2775 2775
    $this->field_name = drupal_strtolower($this->randomName() . '_field_name');
......
2986 2986
    $this->assertResponse(404);
2987 2987
  }
2988 2988
}
2989

  
2990
/**
2991
 * Tests that multi-byte UTF-8 characters are stored and retrieved correctly.
2992
 */
2993
class NodeMultiByteUtf8Test extends NodeWebTestCase {
2994

  
2995
  public static function getInfo() {
2996
    return array(
2997
      'name' => 'Multi-byte UTF-8',
2998
      'description' => 'Test that multi-byte UTF-8 characters are stored and retrieved correctly.',
2999
      'group' => 'Node',
3000
    );
3001
  }
3002

  
3003
  /**
3004
   * Tests that multi-byte UTF-8 characters are stored and retrieved correctly.
3005
   */
3006
  public function testMultiByteUtf8() {
3007
    $connection = Database::getConnection();
3008
    // On MySQL, this test will only run if 'charset' is set to 'utf8mb4' in
3009
    // settings.php.
3010
    if (!($connection->utf8mb4IsSupported() && $connection->utf8mb4IsActive())) {
3011
      return;
3012
    }
3013
    $title = '🐙';
3014
    $this->assertTrue(drupal_strlen($title, 'utf-8') < strlen($title), 'Title has multi-byte characters.');
3015
    $node = $this->drupalCreateNode(array('title' => $title));
3016
    $this->drupalGet('node/' . $node->nid);
3017
    $result = $this->xpath('//h1[@id="page-title"]');
3018
    $this->assertEqual(trim((string) $result[0]), $title, 'The passed title was returned.');
3019
  }
3020

  
3021
}

Formats disponibles : Unified diff