Projet

Général

Profil

Révision 582db59d

Ajouté par Assos Assos il y a plus de 8 ans

Update Drupal core to version 7.40

Voir les différences:

drupal7/modules/filter/filter.test
555 555
    $this->assertTrue(isset($options[$this->allowed_format->format]), 'The allowed text format appears as an option when adding a new node.');
556 556
    $this->assertFalse(isset($options[$this->disallowed_format->format]), 'The disallowed text format does not appear as an option when adding a new node.');
557 557
    $this->assertTrue(isset($options[filter_fallback_format()]), 'The fallback format appears as an option when adding a new node.');
558

  
559
    // Check regular user access to the filter tips pages.
560
    $this->drupalGet('filter/tips/' . $this->allowed_format->format);
561
    $this->assertResponse(200);
562
    $this->drupalGet('filter/tips/' . $this->disallowed_format->format);
563
    $this->assertResponse(403);
564
    $this->drupalGet('filter/tips/' . filter_fallback_format());
565
    $this->assertResponse(200);
566
    $this->drupalGet('filter/tips/invalid-format');
567
    $this->assertResponse(404);
568

  
569
    // Check admin user access to the filter tips pages.
570
    $this->drupalLogin($this->admin_user);
571
    $this->drupalGet('filter/tips/' . $this->allowed_format->format);
572
    $this->assertResponse(200);
573
    $this->drupalGet('filter/tips/' . $this->disallowed_format->format);
574
    $this->assertResponse(200);
575
    $this->drupalGet('filter/tips/' . filter_fallback_format());
576
    $this->assertResponse(200);
577
    $this->drupalGet('filter/tips/invalid-format');
578
    $this->assertResponse(404);
558 579
  }
559 580

  
560 581
  /**
......
1273 1294
    // Create a e-mail that is too long.
1274 1295
    $long_email = str_repeat('a', 254) . '@example.com';
1275 1296
    $too_long_email = str_repeat('b', 255) . '@example.com';
1297
    $email_with_plus_sign = 'one+two@example.com';
1276 1298

  
1277 1299

  
1278 1300
    // Filter selection/pattern matching.
......
1286 1308
      ),
1287 1309
      // MAILTO URLs.
1288 1310
      '
1289
person@example.com or mailto:person2@example.com or ' . $long_email . ' but not ' . $too_long_email . '
1311
person@example.com or mailto:person2@example.com or ' . $email_with_plus_sign . ' or ' . $long_email . ' but not ' . $too_long_email . '
1290 1312
' => array(
1291 1313
        '<a href="mailto:person@example.com">person@example.com</a>' => TRUE,
1292 1314
        '<a href="mailto:person2@example.com">mailto:person2@example.com</a>' => TRUE,
1293 1315
        '<a href="mailto:' . $long_email . '">' . $long_email . '</a>' => TRUE,
1294 1316
        '<a href="mailto:' . $too_long_email . '">' . $too_long_email . '</a>' => FALSE,
1317
        '<a href="mailto:' . $email_with_plus_sign . '">' . $email_with_plus_sign . '</a>' => TRUE,
1295 1318
      ),
1296 1319
      // URI parts and special characters.
1297 1320
      '
......
1983 2006
    }
1984 2007
  }
1985 2008
}
2009

  
2010
/**
2011
 * Tests DOMDocument serialization.
2012
 */
2013
class FilterDOMSerializeTestCase extends DrupalWebTestCase {
2014

  
2015
  public static function getInfo() {
2016
    return array(
2017
      'name' => 'Serialization',
2018
      'description' => 'Test serialization of DOMDocument objects.',
2019
      'group' => 'Filter',
2020
    );
2021
  }
2022

  
2023
  /**
2024
   * Tests empty DOMDocument object.
2025
   */
2026
  function testFilterEmptyDOMSerialization() {
2027
    $document = new DOMDocument();
2028
    $result = filter_dom_serialize($document);
2029
    $this->assertEqual('', $result);
2030
  }
2031
}

Formats disponibles : Unified diff