Make WordPress Core

Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#57171 closed defect (bug) (fixed)

unit test for wp_filesize()

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


Change History (8)

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

19 months ago

  • Keywords has-patch has-unit-tests added

#2 @SergeyBiryukov
19 months ago

In 54861:

Tests: Move wp_filesize() tests to their own file.

This aims to make the tests more discoverable and easier to expand.

Includes splitting the wp_filesize and pre_wp_filesize filter tests into a separate test case.

Follow-up to [52837], [52932], [54402].

Props pbearne, spacedmonkey, SergeyBiryukov.
See #57171.

@spacedmonkey commented on PR #3660:

19 months ago

There were unit tests in the original PR -

I may have forgotten to commit these 😮‍💨


#4 @SergeyBiryukov
19 months ago

In 54862:

Tests: Add a public visibility to wp_filesize() tests.

Follow-up to [52010], [52837], [52932], [54861].

See #57171.

#5 @SergeyBiryukov
19 months ago

  • Milestone changed from Awaiting Review to 6.2
  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

@SergeyBiryukov commented on PR #3660:

19 months ago

Thanks for the PR!

It looks like there were some pre-existing tests for this function added in r52837 and moved to a separate file in r54861.

Keeping the ticket open for now to see if anything from this PR should be added to the existing tests (though at a glance it seems like they are mostly the same), as well as to commit some other tests pointed out above.

#7 @SergeyBiryukov
19 months ago

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

In 54863:

Tests: Add unit tests for attachment’s file size being included in metadata.

These tests ensure that wp_generate_attachment_metadata() stores the file size of all newly uploaded attachments under the filesize array key. The tests were initially supposed to be committed with [52837].

Follow-up to [52837], [52932], [54861].

Props spacedmonkey, johnwatkins0, mitogh, adamsilverstein, pbearne, SergeyBiryukov.
Fixes #57171.

@SergeyBiryukov commented on PR #3660:

19 months ago

I believe this is fixed as of r54861 and r54863.

Note: See TracTickets for help on using tickets.