You are here

public function ClockConfigureTestCase::testClockInterfaceCustomDateFormat in Clock 6

File

./clock.test, line 128
Tests for Clock module.

Class

ClockConfigureTestCase

Code

public function testClockInterfaceCustomDateFormat() {
  $this
    ->drupalGet('admin/build/block/configure/clock/clock');
  $this
    ->assertNoText('Custom date format', 'Make sure the "Custom date format" setting is not available when no custom date formats are defined.');
  $edit = array();
  $edit['add_date_format'] = 'g:i a';
  $this
    ->drupalPost('admin/settings/date-time/formats/add', $edit, 'Save configuration');
  $this
    ->drupalGet('admin/build/block/configure/clock/clock');
  $this
    ->assertText('Custom date format', 'Make sure the "Custom date format" setting is available when custom date formats are defined.');
  $custom_date_format = date_format_date(date_now(), 'custom', 'g:i a');
  $this
    ->assertText($custom_date_format, 'Make sure custom date formats show up.');
}