You are here

public function MakemeetingPollAdminTestCase::testTimezone in Make Meeting Scheduler 7.2

Test answering the makemeeting poll

File

./makemeeting.test, line 205
Makemeeting tests

Class

MakemeetingPollAdminTestCase
Test for the creation of a makemeeting poll.

Code

public function testTimezone() {

  // Fill in a default event node form with some suggestions, as Paris user
  $this
    ->_testCreateField();
  $this
    ->_testFillMakemeetingForm();

  // Create the event as is
  $this
    ->drupalPost(NULL, array(), t('Save'));
  $base = '<input title="%s" type="checkbox" id="edit-answers-22-05-2012sugg1" name="answers[22-05-2012:sugg:1]" value="1" class="form-checkbox"';
  $this
    ->assertRaw(sprintf($base, 'Tuesday 22 May 2012 23:15'), 'Right timezone');
  $url = $this
    ->getUrl();

  // Log as an american, should have -6 hours
  $this
    ->drupalLogin($this->lambda_user);
  $this
    ->drupalGet($url);
  $this
    ->assertRaw(sprintf($base, 'Tuesday 22 May 2012 17:15'), 'Right timezone');

  // Log as aa greek, should have +1 hours
  $this
    ->drupalLogin($this->lambda_user2);
  $this
    ->drupalGet($url);
  $this
    ->assertRaw(sprintf($base, 'Wednesday 23 May 2012 00:15'), 'Right timezone');
}