Skip to:
Content

Opened 4 months ago

Closed 5 weeks ago

#7432 closed defect (bug) (fixed)

Test depends on PHP EXIF support; should fail more gracefully when absent

Reported by: boonebgorges Owned by: r-a-y
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.4.0
Component: Media Keywords: has-patch
Cc:

Description

Related: #7019

If PHP is not compiled with EXIF support, BP_Tests_BP_Attachment_TestCases::test_bp_attachment_get_image_data() fails. The test is written in a way that makes it dependent on data fetched via exif_read_data() (as opposed to some of the other data fetched by wp_read_image_metadata()). I think this is probably fine, but we should skip the test if EXIF support is not in place:

if ( ! is_callable( 'exif_read_data' ) ) {
    $this->markTestSkipped( 'This test requires PHP to be compiled with EXIF support.' );
}

Attachments (1)

7432.01.patch (1.4 KB) - added by r-a-y 2 months ago.

Download all attachments as: .zip

Change History (3)

@r-a-y
2 months ago

#1 @r-a-y
2 months ago

  • Keywords has-patch added
  • Version set to 2.4.0

This one was annoying me a bit.

01.patch also skips tests that require PHP to have either the GD or Imagemagick extension enabled.

#2 @r-a-y
5 weeks ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 11540:

Unit Tests: Skip tests requiring certain PHP extensions active.

Some of our attachment unit tests require certain PHP extensions to be
active. If the current unit testing environment does not have these PHP
extensions active, we should skip these tests from running.

Props boonebgorges, r-a-y.

Fixes #7432.

Note: See TracTickets for help on using tickets.