Make WordPress Core


Ignore:
Timestamp:
05/06/2022 11:09:54 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Improve the logic of the SECURITY.md test to check all supported versions.

This avoids a test failure if the list of supported WordPress versions is updated before the trunk version is bumped for a new major release.

Follow-up to [47403], [53347].

Fixes #55667.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme.php

    r53349 r53357  
    222222            $path_to_readme_txt = $wp_theme->get_theme_root() . '/' . $wp_theme->get_stylesheet() . '/readme.txt';
    223223            $this->assertFileExists( $path_to_readme_txt );
     224
    224225            $readme    = file_get_contents( $path_to_readme_txt );
    225226            $this_year = gmdate( 'Y' );
     
    227228            preg_match( '#Copyright (\d+) WordPress.org#', $readme, $matches );
    228229            if ( $matches ) {
    229                 $this->assertSame( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
     230                $readme_year = trim( $matches[1] );
     231
     232                $this->assertSame( $this_year, $readme_year, "Bundled themes readme.txt's year needs to be updated to $this_year." );
    230233            }
    231234
    232235            preg_match( '#Copyright 20\d\d-(\d+) WordPress.org#', $readme, $matches );
    233236            if ( $matches ) {
    234                 $this->assertSame( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
     237                $readme_year = trim( $matches[1] );
     238
     239                $this->assertSame( $this_year, $readme_year, "Bundled themes readme.txt's year needs to be updated to $this_year." );
    235240            }
    236241        }
Note: See TracChangeset for help on using the changeset viewer.