WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 5 months ago

Last modified 5 months ago

#52922 closed enhancement (fixed)

WP_Test_Stream: Add seeking capability for testing streams

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

Description

Propose adding seeking capability to the WP_Test_Stream in-memory streamWrapper.

Seeking is required for automated testing of Media streams for functions such as

  • getimagesize (used in wp_getimagesize)
  • exif_read_data (used in wp_read_image_metadata)

For example, #52826 notes an issue with streams; however, integration tests are blocked due to WP_Test_Stream not supporting seeking.

Change History (7)

#1 @hellofromTonya
6 months ago

  • Owner set to hellofromTonya

This ticket was mentioned in Slack in #core-media by hellofromtonya. View the logs.


6 months ago

This ticket was mentioned in PR #1131 on WordPress/wordpress-develop by hellofromtonya.


6 months ago

  • Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed

Trac ticket: https://core.trac.wordpress.org/ticket/52922

  • Adds stream tests to wp_read_image_metadata to validate seeking works
  • Adds WP_Test_Stream::stream_seek for seeking functionality which is needed for:
    • getimagesize (used in wp_getimagesize)
    • exif_read_data (used in wp_read_image_metadata)

#4 @hellofromTonya
6 months ago

  • Summary changed from `WP_Test_Stream` : Add seeking capability for testing streams to WP_Test_Stream: Add seeking capability for testing streams

PR 1131 is ready. @peterwilsoncc can you do a review and, if okay, get it committed please?

This ticket was mentioned in Slack in #core-media by hellofromtonya. View the logs.


6 months ago

#6 @peterwilsoncc
5 months ago

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

In 50771:

Build/Test Tools: Add seeking support to stream test library.

Introduces seeking to the WP_Test_Stream stream wrapper. This allows the testing of wp_getimagesize() and wp_read_image_metadata() among others. Includes tests for the latter.

Props hellofromTonya.
Fixes #52922.
See #52826.

Note: See TracTickets for help on using tickets.