Projet

Général

Profil

Révision c9e51f47

Ajouté par Julien Enselme il y a environ 7 ans

Udpate to 7.54

Voir les différences:

drupal7/modules/system/system.test
1461 1461
  }
1462 1462
}
1463 1463

  
1464
/**
1465
 * Tests date format configuration.
1466
 */
1467
class DateFormatTestCase extends DrupalWebTestCase {
1468
  public static function getInfo() {
1469
    return array(
1470
      'name' => 'Date format',
1471
      'description' => 'Test date format configuration and defaults.',
1472
      'group' => 'System',
1473
    );
1474
  }
1475

  
1476
  function setUp() {
1477
    parent::setUp();
1478

  
1479
    // Create admin user and log in admin user.
1480
    $this->admin_user = $this->drupalCreateUser(array('administer site configuration'));
1481
    $this->drupalLogin($this->admin_user);
1482
  }
1483

  
1484
  /**
1485
   * Test the default date type formats are consistent.
1486
   */
1487
  function testDefaultDateFormats() {
1488
    // These are the default format values from format_date().
1489
    $default_formats = array(
1490
      'short' => 'm/d/Y - H:i',
1491
      'medium' => 'D, m/d/Y - H:i',
1492
      'long' => 'l, F j, Y - H:i',
1493
    );
1494

  
1495
    // Clear the date format variables.
1496
    variable_del('date_format_short');
1497
    variable_del('date_format_medium');
1498
    variable_del('date_format_long');
1499

  
1500
    $this->drupalGet('admin/config/regional/date-time');
1501

  
1502
    foreach ($default_formats as $format_name => $format_value) {
1503
      $id = 'edit-date-format-' . $format_name;
1504
      // Check that the configuration fields match the default format.
1505
      $this->assertOptionSelected(
1506
        $id,
1507
        $format_value,
1508
        format_string('The @type format type matches the expected format @format.',
1509
        array(
1510
          '@type' => $format_name,
1511
          '@format' => $format_value,
1512
        )
1513
      ));
1514
    }
1515
  }
1516
}
1517

  
1464 1518
class PageTitleFiltering extends DrupalWebTestCase {
1465 1519
  protected $content_user;
1466 1520
  protected $saved_title;

Formats disponibles : Unified diff