Changeset 65850
- Timestamp:
- 12/01/2026 01:38:01 PM (2 hours ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/update.php (modified) (1 diff)
-
tests/phpunit/tests/functions/wpGetUpdateData.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/update.php
r65226 r65850 1113 1113 } 1114 1114 1115 if ( ( $core || $plugins || $themes ) && wp_get_translation_updates()) {1116 $counts['translations'] = 1;1115 if ( $core || $plugins || $themes ) { 1116 $counts['translations'] = count( wp_get_translation_updates() ); 1117 1117 } 1118 1118 -
trunk/tests/phpunit/tests/functions/wpGetUpdateData.php
r65388 r65850 300 300 301 301 /** 302 * Tests that translation updates in any update transient are counted once. 303 * 304 * @ticket 65819 302 * Tests that each translation update in any update transient is counted. 303 * 304 * @ticket 65819 305 * @ticket 66806 305 306 * 306 307 * @dataProvider data_update_transients … … 308 309 * @param string $transient The update transient holding the translations. 309 310 */ 310 public function test_should_count_ translation_updates_once( $transient ) {311 public function test_should_count_each_translation_update( $transient ) { 311 312 wp_set_current_user( self::$admin_id ); 312 313 … … 323 324 $data = wp_get_update_data(); 324 325 325 $this->assertSame( 1, $data['counts']['translations'], 'Translation updates should be counted once.' );326 $this->assertSame( 2, $data['counts']['translations'], 'Each translation update should be counted.' ); 326 327 $this->assertSame( 'Translation Updates', $data['title'], 'The title should mention translation updates.' ); 328 } 329 330 /** 331 * Tests that translation updates across all update transients are counted together. 332 * 333 * @ticket 66806 334 */ 335 public function test_should_count_translation_updates_across_transients() { 336 wp_set_current_user( self::$admin_id ); 337 338 foreach ( self::$transients as $transient ) { 339 set_site_transient( 340 $transient, 341 (object) array( 342 'translations' => array( 343 array( 'language' => 'de_DE' ), 344 ), 345 ) 346 ); 347 } 348 349 $this->assertSame( 3, wp_get_update_data()['counts']['translations'] ); 327 350 } 328 351
Note:
See TracChangeset
for help on using the changeset viewer.