Make WordPress Core

Changeset 60749 for branches/6.4


Ignore:
Timestamp:
09/15/2025 08:05:38 PM (2 months ago)
Author:
desrosj
Message:

Build/Test Tools: Fix tooling and PHPUnit test issues.

This fixes the PHPUnit test suite for the 6.4 branch by:

  • Fixing issues with the env:install script when using newer PHP images.
  • Temporarily disables failing tests with ImageMagick 7 is in use.

Backports [60735] and [60736] to the 6.4 branch.

See #63876, #63932.

Location:
branches/6.4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/6.4

  • branches/6.4/tests/phpunit/tests/image/editorImagick.php

    r56559 r60749  
    657657        }
    658658
     659        $version = Imagick::getVersion();
     660        if ( $version['versionNumber'] < 0x675 ) {
     661            $this->markTestSkipped( 'The version of ImageMagick does not support removing alpha channels from PDFs.' );
     662        }
     663
    659664        $test_file     = DIR_TESTDATA . '/images/test-alpha.pdf';
    660665        $attachment_id = $this->factory->attachment->create_upload_object( $test_file );
  • branches/6.4/tests/phpunit/tests/image/resize.php

    r54226 r60749  
    2424        $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 25, 25 );
    2525
     26        $this->assertNotWPError( $image );
     27
    2628        list( $w, $h, $type ) = getimagesize( $image );
    2729
     
    7981        $image = $this->resize_helper( $file, 25, 25 );
    8082
     83        $this->assertNotWPError( $image );
     84
    8185        list( $w, $h, $type ) = wp_getimagesize( $image );
    8286
     
    100104        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 96 );
    101105
     106        $this->assertNotWPError( $image );
     107
    102108        list( $w, $h, $type ) = getimagesize( $image );
    103109
     
    113119        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 0 );
    114120
     121        $this->assertNotWPError( $image );
     122
    115123        list( $w, $h, $type ) = getimagesize( $image );
    116124
     
    126134        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 0, 96 );
    127135
     136        $this->assertNotWPError( $image );
     137
    128138        list( $w, $h, $type ) = getimagesize( $image );
    129139
     
    139149        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 150, true );
    140150
     151        $this->assertNotWPError( $image );
     152
    141153        list( $w, $h, $type ) = getimagesize( $image );
    142154
     
    164176    public function test_resize_thumb_50x150_crop() {
    165177        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 50, 150, true );
     178
     179        $this->assertNotWPError( $image );
    166180
    167181        list( $w, $h, $type ) = getimagesize( $image );
     
    189203    /**
    190204     * Function to help out the tests
     205     *
     206     * @return string|WP_Error The path to the resized image file or a WP_Error on failure.
    191207     */
    192208    protected function resize_helper( $file, $width, $height, $crop = false ) {
  • branches/6.4/tests/phpunit/tests/media.php

    r57020 r60749  
    52855285        // Sub-sizes: for each size, the JPEGs should be smaller than the WebP.
    52865286        $sizes_to_compare = array_intersect_key( $jpeg_sizes['sizes'], $webp_sizes['sizes'] );
     5287
     5288        $this->assertNotWPError( $sizes_to_compare );
     5289
    52875290        foreach ( $sizes_to_compare as $size => $size_data ) {
    52885291            $this->assertLessThan( $webp_sizes['sizes'][ $size ]['filesize'], $jpeg_sizes['sizes'][ $size ]['filesize'] );
  • branches/6.4/tools/local-env/scripts/install.js

    r58276 r60749  
    3737wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } )
    3838    .then( () => {
    39         wp_cli( 'db reset --yes' );
     39        wp_cli( 'db reset --yes --defaults' );
    4040        wp_cli( `core install --title="WordPress Develop" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:${process.env.LOCAL_PORT}` );
    4141    } );
Note: See TracChangeset for help on using the changeset viewer.