Make WordPress Core

Ticket #17626: 17626.5.diff

File 17626.5.diff, 2.2 KB (added by joemcgill, 9 years ago)

Fixes tests for PHP 5.2

  • tests/phpunit/tests/image/intermediate_size.php

    diff --git tests/phpunit/tests/image/intermediate_size.php tests/phpunit/tests/image/intermediate_size.php
    index 4458f6a..db80f94 100644
    class Tests_Image_Intermediate_Size extends WP_UnitTestCase { 
    9898
    9999                // test for the expected string because the array will by definition
    100100                // return with the correct height and width attributes
    101                 $this->assertNotFalse( strpos( $image['file'], '330x220' ) );
     101                $this->assertTrue( strpos( $image['file'], '330x220' ) > 0 );
    102102
    103103                // cleanup
    104104                remove_image_size( 'test-size' );
    class Tests_Image_Intermediate_Size extends WP_UnitTestCase { 
    122122
    123123                // test for the expected string because the array will by definition
    124124                // return with the correct height and width attributes
    125                 $this->assertNotFalse( strpos( $image['file'], '330x220' ) );
     125                $this->assertTrue( strpos( $image['file'], '330x220' ) > 0 );
    126126
    127127                // cleanup
    128128                remove_image_size( 'test-size' );
    class Tests_Image_Intermediate_Size extends WP_UnitTestCase { 
    149149
    150150                // you have to test for the string because the image will by definition
    151151                // return with the correct height and width attributes
    152                 $this->assertNotFalse( strpos( $image['file'], '450x300' ) );
     152                $this->assertTrue( strpos( $image['file'], '450x300' ) > 0 );
    153153
    154154                // cleanup
    155155                remove_image_size( 'test-size' );
    class Tests_Image_Intermediate_Size extends WP_UnitTestCase { 
    206206
    207207                // test for the expected string because the array will by definition
    208208                // return with the correct height and width attributes
    209                 $this->assertNotFalse( strpos( $image['file'], $image_w . 'x' . $image_h ) );
     209                $this->assertTrue( strpos( $image['file'], $image_w . 'x' . $image_h ) > 0 );
    210210
    211211                // cleanup
    212212                remove_image_size( 'test-size' );
    class Tests_Image_Intermediate_Size extends WP_UnitTestCase { 
    237237
    238238                // test for the expected string because the array will by definition
    239239                // return with the correct height and width attributes
    240                 $this->assertNotFalse( strpos( $image['file'], $image_w . 'x' . $image_h ) );
     240                $this->assertTrue( strpos( $image['file'], $image_w . 'x' . $image_h ) > 0 );
    241241
    242242                // cleanup
    243243                remove_image_size( 'test-size' );