Skip to content

Commit

Permalink
UIV-1526 Add tests for Beginning of YearProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVHG committed Nov 13, 2015
1 parent 3ceedca commit 749c539
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Timestamps/LargeTimestampsHTMLFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,27 @@ public function testFormatsMultipleTimestampsWithStartTime()
);
}

public function testFormatsASingleTimestampBeginningOfYear()
{
$timestamp_list = new CultureFeed_Cdb_Data_Calendar_TimestampList();
$timestamp = new CultureFeed_Cdb_Data_Calendar_Timestamp('2016-01-03', '19:00:00', '23:00:00');
$timestamp_list->add($timestamp);

$output = '<time itemprop="startDate" datetime="2016-01-03T19:00">';
$output .= '<span class="cf-weekday cf-meta">zondag</span> ';
$output .= '<span class="cf-date">3 januari 2016</span> ';
$output .= '<span class="cf-from cf-meta">van</span> ';
$output .= '<span class="cf-time">19:00</span></time> ';
$output .= '<span class="cf-to cf-meta">tot</span> ';
$output .= '<time itemprop="endDate" datetime="2016-01-03T23:00">';
$output .= '<span class="cf-time">23:00</span></time>';

$this->assertEquals(
$output,
$this->formatter->format($timestamp_list)
);
}

public function testFormatsMultipleTimestampsWithStartTimeAndEndTime()
{
$timestamp_list = new CultureFeed_Cdb_Data_Calendar_TimestampList();
Expand Down
16 changes: 16 additions & 0 deletions tests/Timestamps/MediumTimestampsHTMLFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ public function testFormatsASingleTimestamp()
);
}

public function testFormatsASingleTimestampBeginningOfYear()
{
$timestamp_list = new CultureFeed_Cdb_Data_Calendar_TimestampList();
$timestamp = new CultureFeed_Cdb_Data_Calendar_Timestamp('2016-01-03', '19:00:00', '23:00:00');
$timestamp_list->add($timestamp);

$output = '<span class="cf-weekday cf-meta">zondag</span>';
$output .= ' ';
$output .= '<span class="cf-date">3 januari 2016</span>';

$this->assertEquals(
$output,
$this->formatter->format($timestamp_list)
);
}

public function testFormatsASingleTimestampWithoutLeadingZero()
{
$timestamp_list = new CultureFeed_Cdb_Data_Calendar_TimestampList();
Expand Down

0 comments on commit 749c539

Please sign in to comment.