Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#36415 closed enhancement (fixed)

Unit tests for functions.php's get_weekstartend method

Reported by: tloureiro's profile tloureiro Owned by: boonebgorges's profile boonebgorges
Milestone: 4.6 Priority: normal
Severity: normal Version: 0.71
Component: Date/Time Keywords: has-patch has-unit-tests dev-feedback
Focuses: Cc:

Description

Test functions against get_weekstartend.
Tested scenarios:
1) No optional parameter is passed
2) Optional parameter is passed with the non-default option
3) start_of_week option is removed
4) Formatted time is provided from date function
5) No optional parameter is passed

Attachments (1)

get-weekstartend.php.patch (2.3 KB) - added by pbearne 8 years ago.
Unit test

Download all attachments as: .zip

Change History (7)

@pbearne
8 years ago

Unit test

#1 @pbearne
8 years ago

  • Keywords has-patch has-unit-tests added

#2 @pbearne
8 years ago

  • Keywords dev-feedback added

#3 @DrewAPicture
8 years ago

  • Version changed from trunk to 0.71

#4 @swissspidy
8 years ago

  • Milestone changed from Awaiting Review to 4.6

#5 @boonebgorges
8 years ago

  • Owner set to boonebgorges
  • Status changed from new to assigned

@pbearne Thanks for the patch!

The strtotime() tests don't really test get_weekstartend(), they test strtotime() and date(). I don't think we need to do that.

I'm going to add one or two additional tests, and change some wording. Otherwise looks good. Thanks!

#6 @boonebgorges
8 years ago

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

In 37579:

Add tests for get_weekstartend().

Props pbearne, tloureiro.
Fixes #36415.

Note: See TracTickets for help on using tickets.