Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#33750 closed enhancement (fixed)

Unit tests for is_new_day() and the_date()

Reported by: johnbillion Owned by: jubstuff
Priority: low Milestone: 4.4
Component: Date/Time Version:
Severity: normal Keywords: needs-unit-tests good-first-bug has-patch
Cc: Focuses: template

Description

I recall, in days gone by, coming across a bug with is_new_day() and/or the_date() whereby they weren't behaving as expected.

Some unit tests should be introduced for both functions to ensure they work correctly.

Attachments (1)

33750.diff​ (1.9 KB ) - added by jubstuff 11 years ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
11 years ago

is_new_day() is nowhere used in core, so only the_date() is relevant here. It could leverage is_new_day() though.

#2 @jubstuff
11 years ago

  • Keywords has-patch added

I replaced the test in the_date, using is_new_day and attached tests for the_date

#3 @swissspidy
11 years ago

  • Milestone Awaiting Review → 4.4
  • Owner set to jubstuff
  • Status new → assigned

Awesome, people were very productive during today's Contributor Day at WordCamp Switzerland!

Assigning this to jubstuff to mark this good first bug as "claimed".

@johnbillion Are there any more cases that should be covered in the test?

#4 @wonderboymusic
11 years ago

  • Resolution → fixed
  • Status assigned → closed

In 34474:

Date/Time: Add unit tests for the_date().

Props jubstuff.
Fixes #33750.

Note: See TracTickets for help on using tickets.