Make WordPress Core

Changeset 60746 for branches/6.6


Ignore:
Timestamp:
09/15/2025 07:22:09 PM (7 months ago)
Author:
desrosj
Message:

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

This fixes the PHPUnit test suite for the 6.6 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.6 branch.

See #63876, #63932.

Location:
branches/6.6
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/6.6

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

    r56559 r60746  
    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.6/tests/phpunit/tests/image/resize.php

    r57524 r60746  
    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
     
    9397     *
    9498     * @ticket 51228
     99     *
     100     * Temporarily disabled until we can figure out why it fails on the Trixie based PHP container.
     101     * See https://core.trac.wordpress.org/ticket/63932.
     102     * @requires PHP < 8.3
    95103     */
    96104    public function test_resize_avif() {
     
    105113        $image = $this->resize_helper( $file, 25, 25 );
    106114
     115        $this->assertNotWPError( $image );
     116
    107117        list( $w, $h, $type ) = wp_getimagesize( $image );
    108118
     
    126136        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 96 );
    127137
     138        $this->assertNotWPError( $image );
     139
    128140        list( $w, $h, $type ) = getimagesize( $image );
    129141
     
    139151        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 0 );
    140152
     153        $this->assertNotWPError( $image );
     154
    141155        list( $w, $h, $type ) = getimagesize( $image );
    142156
     
    152166        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 0, 96 );
    153167
     168        $this->assertNotWPError( $image );
     169
    154170        list( $w, $h, $type ) = getimagesize( $image );
    155171
     
    165181        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 150, true );
    166182
     183        $this->assertNotWPError( $image );
     184
    167185        list( $w, $h, $type ) = getimagesize( $image );
    168186
     
    190208    public function test_resize_thumb_50x150_crop() {
    191209        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 50, 150, true );
     210
     211        $this->assertNotWPError( $image );
    192212
    193213        list( $w, $h, $type ) = getimagesize( $image );
     
    215235    /**
    216236     * Function to help out the tests
     237     *
     238     * @return string|WP_Error The path to the resized image file or a WP_Error on failure.
    217239     */
    218240    protected function resize_helper( $file, $width, $height, $crop = false ) {
  • branches/6.6/tests/phpunit/tests/media.php

    r58862 r60746  
    53115311        // Sub-sizes: for each size, the JPEGs should be smaller than the WebP.
    53125312        $sizes_to_compare = array_intersect_key( $jpeg_sizes['sizes'], $webp_sizes['sizes'] );
     5313
     5314        $this->assertNotWPError( $sizes_to_compare );
     5315
    53135316        foreach ( $sizes_to_compare as $size => $size_data ) {
    53145317            $this->assertLessThan( $webp_sizes['sizes'][ $size ]['filesize'], $jpeg_sizes['sizes'][ $size ]['filesize'] );
  • branches/6.6/tools/local-env/scripts/install.js

    r58097 r60746  
    3838wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } )
    3939    .then( () => {
    40         wp_cli( 'db reset --yes' );
     40        wp_cli( 'db reset --yes --defaults' );
    4141        const installCommand = process.env.LOCAL_MULTISITE === 'true'  ? 'multisite-install' : 'install';
    4242        wp_cli( `core ${ installCommand } --title="WordPress Develop" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:${process.env.LOCAL_PORT}` );
Note: See TracChangeset for help on using the changeset viewer.