Skip to content

Commit d925c99

Browse files
authored
Merge branch 'trunk' into bundled-themes-7-0
2 parents 96e81ed + 9cee595 commit d925c99

4 files changed

Lines changed: 26 additions & 17 deletions

File tree

src/wp-admin/includes/class-wp-ms-themes-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct( $args = array() ) {
5959

6060
$page = $this->get_pagenum();
6161

62-
$this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;
62+
$this->is_site_themes = 'site-themes-network' === $this->screen->id;
6363

6464
if ( $this->is_site_themes ) {
6565
$this->site_id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;

src/wp-admin/includes/upgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3282,7 +3282,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
32823282
'fieldname' => $tableindex->Column_name,
32833283
'subpart' => $tableindex->Sub_part,
32843284
);
3285-
$index_ary[ $keyname ]['unique'] = ( '0' === (string) $tableindex->Non_unique ) ? true : false;
3285+
$index_ary[ $keyname ]['unique'] = '0' === (string) $tableindex->Non_unique;
32863286
$index_ary[ $keyname ]['index_type'] = $tableindex->Index_type;
32873287
}
32883288

src/wp-admin/nav-menus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@
549549
$menu_count = count( $nav_menus );
550550

551551
// Are we on the add new screen?
552-
$add_new_screen = ( isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'] ) ? true : false;
552+
$add_new_screen = isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'];
553553

554-
$locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false;
554+
$locations_screen = isset( $_GET['action'] ) && 'locations' === $_GET['action'];
555555

556556
$page_count = wp_count_posts( 'page' );
557557

tests/phpunit/tests/pomo/pluralForms.php

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,26 @@ protected static function parenthesize_plural_expression( $expression ) {
3939

4040
/**
4141
* @ticket 41562
42-
* @dataProvider data_locales
4342
* @group external-http
4443
*/
45-
public function test_regression( $lang, $nplurals, $expression ) {
44+
public function test_regression(): void {
4645
require_once dirname( __DIR__, 2 ) . '/includes/plural-form-function.php';
4746

48-
$parenthesized = self::parenthesize_plural_expression( $expression );
49-
$old_style = tests_make_plural_form_function( $nplurals, $parenthesized );
50-
$plural_forms = new Plural_Forms( $expression );
47+
foreach ( self::data_locales() as list( $lang, $nplurals, $expression ) ) {
48+
$parenthesized = self::parenthesize_plural_expression( $expression );
49+
$old_style = tests_make_plural_form_function( $nplurals, $parenthesized );
50+
$plural_forms = new Plural_Forms( $expression );
5151

52-
$generated_old = array();
53-
$generated_new = array();
52+
$generated_old = array();
53+
$generated_new = array();
5454

55-
foreach ( range( 0, 200 ) as $i ) {
56-
$generated_old[] = $old_style( $i );
57-
$generated_new[] = $plural_forms->get( $i );
58-
}
55+
foreach ( range( 0, 200 ) as $i ) {
56+
$generated_old[] = $old_style( $i );
57+
$generated_new[] = $plural_forms->get( $i );
58+
}
5959

60-
$this->assertSame( $generated_old, $generated_new );
60+
$this->assertSame( $generated_old, $generated_new );
61+
}
6162
}
6263

6364
/**
@@ -70,7 +71,15 @@ public function test_locales_file_not_empty() {
7071
$this->assertNotEmpty( $locales, 'Unable to retrieve GP_Locales file' );
7172
}
7273

73-
public static function data_locales() {
74+
/**
75+
* Gets locale data.
76+
*
77+
* Note: Do not use this method directly as a data provider, or else it may cause an unconditional HTTP request
78+
* during PHPUnit initialization. See <https://core.trac.wordpress.org/ticket/64963>.
79+
*
80+
* @return array<int, array{ 0: string, 1: int, 2: string }>
81+
*/
82+
public static function data_locales(): array {
7483
if ( ! class_exists( 'GP_Locales' ) ) {
7584
$filename = download_url( 'https://raw.githubusercontent.com/GlotPress/GlotPress-WP/develop/locales/locales.php' );
7685
if ( is_wp_error( $filename ) ) {

0 commit comments

Comments
 (0)