Skip to content

Commit 623f529

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents bbcc19f + 5e3fced commit 623f529

7 files changed

Lines changed: 15 additions & 13 deletions

File tree

tests/phpunit/tests/compat/mbStrlen.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ class Tests_Compat_mbStrlen extends WP_UnitTestCase {
1313
* Test that the native mb_strlen() is available.
1414
*/
1515
public function test_mb_strlen_availability() {
16-
$this->assertTrue(
17-
in_array( 'mb_strlen', get_defined_functions()['internal'], true ),
16+
$this->assertContains(
17+
'mb_strlen',
18+
get_defined_functions()['internal'],
1819
'Test runner should have `mbstring` extension active but doesn’t.'
1920
);
2021
}

tests/phpunit/tests/compat/mbSubstr.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ class Tests_Compat_mbSubstr extends WP_UnitTestCase {
1313
* Test that mb_substr() is always available (either from PHP or WP).
1414
*/
1515
public function test_mb_substr_availability() {
16-
$this->assertTrue(
17-
in_array( 'mb_substr', get_defined_functions()['internal'], true ),
16+
$this->assertContains(
17+
'mb_substr',
18+
get_defined_functions()['internal'],
1819
'Test runner should have `mbstring` extension active but doesn’t.'
1920
);
2021
}

tests/phpunit/tests/post/types.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public function test_unregister_post_type_removes_query_vars() {
343343

344344
$this->assertIsInt( array_search( 'bar', $wp->public_query_vars, true ) );
345345
$this->assertTrue( unregister_post_type( 'foo' ) );
346-
$this->assertFalse( array_search( 'bar', $wp->public_query_vars, true ) );
346+
$this->assertNotContains( 'bar', $wp->public_query_vars );
347347
}
348348

349349
/**
@@ -463,8 +463,8 @@ public function test_unregister_post_type_removes_post_type_from_taxonomies() {
463463
$this->assertIsInt( array_search( 'foo', $wp_taxonomies['category']->object_type, true ) );
464464
$this->assertIsInt( array_search( 'foo', $wp_taxonomies['post_tag']->object_type, true ) );
465465
$this->assertTrue( unregister_post_type( 'foo' ) );
466-
$this->assertFalse( array_search( 'foo', $wp_taxonomies['category']->object_type, true ) );
467-
$this->assertFalse( array_search( 'foo', $wp_taxonomies['post_tag']->object_type, true ) );
466+
$this->assertNotContains( 'foo', $wp_taxonomies['category']->object_type );
467+
$this->assertNotContains( 'foo', $wp_taxonomies['post_tag']->object_type );
468468
$this->assertEmpty( get_object_taxonomies( 'foo' ) );
469469
}
470470

tests/phpunit/tests/post/wpPostType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public function test_adds_rewrite_rules() {
171171
$post_type_object->remove_rewrite_rules();
172172
$rewrite_tags_after = $wp_rewrite->rewritecode;
173173

174-
$this->assertNotFalse( array_search( "%$post_type%", $rewrite_tags, true ) );
175-
$this->assertFalse( array_search( "%$post_type%", $rewrite_tags_after, true ) );
174+
$this->assertContains( "%$post_type%", $rewrite_tags );
175+
$this->assertNotContains( "%$post_type%", $rewrite_tags_after );
176176
}
177177

178178
public function test_register_meta_boxes() {

tests/phpunit/tests/taxonomy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ public function test_unregister_taxonomy_removes_query_vars() {
895895

896896
$this->assertIsInt( array_search( 'bar', $wp->public_query_vars, true ) );
897897
$this->assertTrue( unregister_taxonomy( 'foo' ) );
898-
$this->assertFalse( array_search( 'bar', $wp->public_query_vars, true ) );
898+
$this->assertNotContains( 'bar', $wp->public_query_vars );
899899
}
900900

901901
/**

tests/phpunit/tests/term/wpTaxonomy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public function test_adds_rewrite_rules() {
7474
$taxonomy_object->remove_rewrite_rules();
7575
$rewrite_tags_after = $wp_rewrite->rewritecode;
7676

77-
$this->assertNotFalse( array_search( "%$taxonomy%", $rewrite_tags, true ) );
78-
$this->assertFalse( array_search( "%$taxonomy%", $rewrite_tags_after, true ) );
77+
$this->assertContains( "%$taxonomy%", $rewrite_tags );
78+
$this->assertNotContains( "%$taxonomy%", $rewrite_tags_after );
7979
}
8080

8181
public function test_adds_ajax_callback() {

tests/phpunit/tests/theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public function test_switch_theme() {
457457
$this->assertSame( $theme['Stylesheet'], get_stylesheet() );
458458

459459
$root_fs = $theme->get_theme_root();
460-
$this->assertTrue( is_dir( $root_fs ) );
460+
$this->assertDirectoryExists( $root_fs );
461461

462462
$root_uri = $theme->get_theme_root_uri();
463463
$this->assertNotEmpty( $root_uri );

0 commit comments

Comments
 (0)