Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#33750 closed enhancement (fixed)

Unit tests for is_new_day() and the_date()

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


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 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
9 years ago

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

9 years ago

#2 @jubstuff
9 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
9 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to jubstuff
  • Status changed from new to 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
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34474:

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

Props jubstuff.
Fixes #33750.

Note: See TracTickets for help on using tickets.