Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#57171 closed defect (bug) (fixed)

unit test for wp_filesize()

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

Description


Change History (8)

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


4 years ago
#1

  • Keywords has-patch has-unit-tests added

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


4 years 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
4 years ago

In 54862:

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

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

See #57171.

#5 @SergeyBiryukov
4 years ago

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

​@SergeyBiryukov commented on ​PR #3660:


4 years 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
4 years ago

  • Resolution → fixed
  • Status accepted → 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:


4 years ago
#8

I believe this is fixed as of r54861 and r54863.

Note: See TracTickets for help on using tickets.