1.20.x system.test DateTimeFunctionalTest::testDateFormatStorage()

Test if the date formats are stored properly.

File

modules/system/tests/system.test, line 1436
Tests for system.module.

Class

DateTimeFunctionalTest
Tests generic date and time handling capabilities of Backdrop.

Code

function testDateFormatStorage() {
  $date_format_info = array(
    'label' => 'testDateFormatStorage Short Format',
    'name' => 'test_short',
    'pattern' => 'dmYHis',
  );

  system_date_format_save($date_format_info);

  $format = config_get('system.date', 'formats.test_short.pattern');
  $this->assertEqual('dmYHis', $format, 'Date format resides in general config.');
}