Make WordPress Core

Opened 3 months ago

Closed 2 months ago

Last modified 7 weeks ago

#59931 closed defect (bug) (fixed)

PHPunit test for _wp_mysql_week()

Reported by: pbearne's profile pbearne Owned by: jorbin's profile jorbin
Milestone: 6.5 Priority: normal
Severity: normal Version: 3.0
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:


Change History (7)

#1 @pbearne
3 months ago

  • Summary changed from PHPunit test for wp() to PHPunit test for _wp_mysql_week()

This ticket was mentioned in PR #5682 on WordPress/wordpress-develop by @pbearne.

3 months ago

  • Keywords has-patch has-unit-tests added

#3 @pbearne
3 months ago

I have the test for this function as it is

But I am confused why we use DATE_SUB function and not just return the 2 to 6 as the 2nd parm of the week function?

#4 @jorbin
3 months ago

  • Milestone changed from Awaiting Review to 6.5
  • Version set to 3.0

Introduced in [14499] for ticket #10397.

The second param of WEEK isn't the day of the week, it's the mode while the start_of_week option is the "first day of the week" and accepts any day as the first.

Milestoning for commit consideration.

#5 @jorbin
2 months ago

  • Owner set to jorbin
  • Resolution set to fixed
  • Status changed from new to closed

In 57207:

Build/Test: Add Tests for _wp_mysql_week.

Props pbearne.
Fixes #59931.

#6 @SergeyBiryukov
2 months ago

In 57208:

Tests: Correct the @group annotation for _wp_mysql_week() tests.

Includes updating the data provider name for consistency.

Follow-up to [57207].

See #59931.

@SergeyBiryukov commented on PR #5682:

7 weeks ago

Thanks for the PR! This was merged in r57207.

Note: See TracTickets for help on using tickets.