Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/phpunit/tests/compat/mbStrlen.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class Tests_Compat_mbStrlen extends WP_UnitTestCase {
* Test that the native mb_strlen() is available.
*/
public function test_mb_strlen_availability() {
$this->assertTrue(
in_array( 'mb_strlen', get_defined_functions()['internal'], true ),
$this->assertContains(
'mb_strlen',
get_defined_functions()['internal'],
'Test runner should have `mbstring` extension active but doesn’t.'
);
}
Expand Down
5 changes: 3 additions & 2 deletions tests/phpunit/tests/compat/mbSubstr.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class Tests_Compat_mbSubstr extends WP_UnitTestCase {
* Test that mb_substr() is always available (either from PHP or WP).
*/
public function test_mb_substr_availability() {
$this->assertTrue(
in_array( 'mb_substr', get_defined_functions()['internal'], true ),
$this->assertContains(
'mb_substr',
get_defined_functions()['internal'],
'Test runner should have `mbstring` extension active but doesn’t.'
);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/tests/post/types.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public function test_unregister_post_type_removes_query_vars() {

$this->assertIsInt( array_search( 'bar', $wp->public_query_vars, true ) );
$this->assertTrue( unregister_post_type( 'foo' ) );
$this->assertFalse( array_search( 'bar', $wp->public_query_vars, true ) );
$this->assertNotContains( 'bar', $wp->public_query_vars );
}

/**
Expand Down Expand Up @@ -463,8 +463,8 @@ public function test_unregister_post_type_removes_post_type_from_taxonomies() {
$this->assertIsInt( array_search( 'foo', $wp_taxonomies['category']->object_type, true ) );
$this->assertIsInt( array_search( 'foo', $wp_taxonomies['post_tag']->object_type, true ) );
$this->assertTrue( unregister_post_type( 'foo' ) );
$this->assertFalse( array_search( 'foo', $wp_taxonomies['category']->object_type, true ) );
$this->assertFalse( array_search( 'foo', $wp_taxonomies['post_tag']->object_type, true ) );
$this->assertNotContains( 'foo', $wp_taxonomies['category']->object_type );
$this->assertNotContains( 'foo', $wp_taxonomies['post_tag']->object_type );
$this->assertEmpty( get_object_taxonomies( 'foo' ) );
}

Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/post/wpPostType.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ public function test_adds_rewrite_rules() {
$post_type_object->remove_rewrite_rules();
$rewrite_tags_after = $wp_rewrite->rewritecode;

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

public function test_register_meta_boxes() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ public function test_unregister_taxonomy_removes_query_vars() {

$this->assertIsInt( array_search( 'bar', $wp->public_query_vars, true ) );
$this->assertTrue( unregister_taxonomy( 'foo' ) );
$this->assertFalse( array_search( 'bar', $wp->public_query_vars, true ) );
$this->assertNotContains( 'bar', $wp->public_query_vars );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/term/wpTaxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public function test_adds_rewrite_rules() {
$taxonomy_object->remove_rewrite_rules();
$rewrite_tags_after = $wp_rewrite->rewritecode;

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

public function test_adds_ajax_callback() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public function test_switch_theme() {
$this->assertSame( $theme['Stylesheet'], get_stylesheet() );

$root_fs = $theme->get_theme_root();
$this->assertTrue( is_dir( $root_fs ) );
$this->assertDirectoryExists( $root_fs );

$root_uri = $theme->get_theme_root_uri();
$this->assertNotEmpty( $root_uri );
Expand Down
Loading