Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/27/2017 04:01:06 AM (7 years ago)
Author:
r-a-y
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/class-bp-attachment.php

    r11256 r11540  
    378378     */
    379379    public function test_bp_attachment_avatar_shrink() {
     380        if ( false === _wp_image_editor_choose() ) {
     381            $this->markTestSkipped( 'This test requires PHP to have a valid image editor that is compatible with WordPress.' );
     382        }
     383
    380384        $image = BP_TESTS_DIR . 'assets/upside-down.jpg';
    381385
     
    422426     */
    423427    public function test_bp_attachment_cover_image_fit() {
     428        if ( false === _wp_image_editor_choose() ) {
     429            $this->markTestSkipped( 'This test requires PHP to have a valid image editor that is compatible with WordPress.' );
     430        }
     431
    424432        $image = BP_TESTS_DIR . 'assets/upside-down.jpg';
    425433
     
    457465     */
    458466    public function test_bp_attachment_get_image_data() {
     467        if ( ! is_callable( 'exif_read_data' ) ) {
     468            $this->markTestSkipped( 'This test requires PHP to be compiled with EXIF support.' );
     469        }
     470
    459471        $image_data = BP_Attachment::get_image_data( BP_TESTS_DIR . 'assets/upside-down.jpg' );
    460472
Note: See TracChangeset for help on using the changeset viewer.