From 2844194a44fed4668ed3e6fec119cdf51753ec47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Fri, 28 Aug 2026 10:11:12 +0200 Subject: [PATCH 1/2] Tests: Use `assertIsNotArray()` for array type assertions. Replaces the generic `assertFalse( is_array() )` assertion in `Tests_Theme::test_get_theme()` with PHPUnit's dedicated `assertIsNotArray()`, which states the intent directly and produces a more descriptive failure message on failure. --- tests/phpunit/tests/theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index e3b16212650de..7b0b25ac384f2 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -94,8 +94,8 @@ public function test_get_theme() { foreach ( array_keys( $themes ) as $name ) { $theme = get_theme( $name ); - // WP_Theme implements ArrayAccess. Even ArrayObject returns false for is_array(). - $this->assertFalse( is_array( $theme ) ); + // WP_Theme implements ArrayAccess, but is not an array. Not even ArrayObject is. + $this->assertIsNotArray( $theme ); $this->assertInstanceOf( 'WP_Theme', $theme ); $this->assertSame( $theme, $themes[ $name ] ); } From 244d373bf521245d37ae7df07d1c5deceeac6ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Fri, 28 Aug 2026 10:16:41 +0200 Subject: [PATCH 2/2] Tests: Use `assertIsNotArray()` for array type assertions. Replaces the generic `assertFalse( is_array() )` assertion in `Tests_Theme::test_get_theme()` with PHPUnit's dedicated `assertIsNotArray()`, which states the intent directly and produces a more descriptive failure message on failure. --- tests/phpunit/tests/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 7b0b25ac384f2..23a61eca2b6eb 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -94,7 +94,7 @@ public function test_get_theme() { foreach ( array_keys( $themes ) as $name ) { $theme = get_theme( $name ); - // WP_Theme implements ArrayAccess, but is not an array. Not even ArrayObject is. + // WP_Theme implements ArrayAccess, but that does not make it an array. $this->assertIsNotArray( $theme ); $this->assertInstanceOf( 'WP_Theme', $theme ); $this->assertSame( $theme, $themes[ $name ] );