Make WordPress Core

Opened 2 months ago

Closed 2 months ago

Last modified 2 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:

Description


Change History (8)

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


2 months ago
#1

  • Keywords has-patch has-unit-tests added

#2 @SergeyBiryukov
2 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:


2 months ago
#3

There were unit tests in the original PR - https://github.com/WordPress/wordpress-develop/pull/2367/files#diff-032b8ca66e0285a30919e60d55165db1e4ab54666b9012512f9e003ca9e07b84

I may have forgotten to commit these 😮‍💨

@SergeyBiryukov

#4 @SergeyBiryukov
2 months ago

In 54862:

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

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

See #57171.

#5 @SergeyBiryukov
2 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:


2 months ago
#6

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
2 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:


2 months ago
#8

I believe this is fixed as of r54861 and r54863.

Note: See TracTickets for help on using tickets.