WordPress/wp-includes/version.php
Sergey Biryukov 0562036947 Tests: Correct the cache invalidation tests for old date or slug redirect.
This affects:
* `Tests_Rewrite_OldDateRedirect::test_old_date_redirect_cache_invalidation()`
* `Tests_Rewrite_OldSlugRedirect::test_old_slug_redirect_cache_invalidation()`

In the former test, the `$post_id` property is declared as `static`, so can only be approached as static, even when used within the same class in which the property is declared.

Using non-static access will result in `null`. See: https://3v4l.org/93HQL

This PHP notice was hidden so far, due to the existence of magic methods in the `WP_UnitTestCase_Base class`.

All the same, the magic methods as they were, would also return `null` for this property. All in all, the post being updated for this test would never get the correct `post_id`.

Fixed by using static access to approach the `static` property.

On a related note, the described bug fix (using the actual `$post_id` instead of `null`) exposed that this test was as a matter of fact failing. This was just hidden by the first bug.

Based on the original commit introducing the test, an adjustment is now made which appears to be what the test actually ''intended'' to test. A similar change is made to the cache invalidation test for old slug redirects. While not strictly required, it brings some consistency between the two tests and ensures that both tests use a unique `post_name` value to avoid collisions with the previous values.

This bug was discovered while fixing (removing) the magic methods in the `WP_UnitTestCase_Base` class in an effort to improve compatibility with PHP 8.2.

Follow-up to [53549].

Props jrf, costdev, SergeyBiryukov.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54077


git-svn-id: http://core.svn.wordpress.org/trunk@53636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-06 01:01:12 +00:00

48 lines
939 B
PHP

<?php
/**
* WordPress Version
*
* Contains version information for the current WordPress release.
*
* @package WordPress
* @since 1.2.0
*/
/**
* The WordPress version string.
*
* Holds the current version number for WordPress core. Used to bust caches
* and to enable development mode for scripts when running from the /src directory.
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-54077';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
$wp_db_version = 53496;
/**
* Holds the TinyMCE version.
*
* @global string $tinymce_version
*/
$tinymce_version = '49110-20201110';
/**
* Holds the required PHP version.
*
* @global string $required_php_version
*/
$required_php_version = '5.6.20';
/**
* Holds the required MySQL version.
*
* @global string $required_mysql_version
*/
$required_mysql_version = '5.0';