Skip to content

Commit 60973dd

Browse files
westonruterpeterwilsoncc
authored andcommitted
Use PHPUnit assertion methods
1 parent 883cef0 commit 60973dd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/wp-includes/general-template.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4676,12 +4676,16 @@ function paginate_links( $args = '' ) {
46764676
* incorrect URL to the correctly formatted one. This presents an
46774677
* unnecessary performance hit.
46784678
*/
4679+
<<<<<<< HEAD
46794680
if ( $wp_rewrite->using_permalinks() && ! $wp_rewrite->use_trailing_slashes ) {
46804681
$pagenum_link = untrailingslashit( $url_parts[0] );
46814682
} else {
46824683
$pagenum_link = trailingslashit( $url_parts[0] );
46834684
}
46844685
$pagenum_link .= '%_%';
4686+
=======
4687+
$pagenum_link = user_trailingslashit( $url_parts[0] );
4688+
>>>>>>> d52bdb7a8f (Use PHPUnit assertion methods)
46854689

46864690
// URL base depends on permalink settings.
46874691
$format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';

tests/phpunit/tests/general/paginateLinks.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ): void
2121
'name' => 'Categorized',
2222
)
2323
);
24-
assert( is_int( $category_id ) );
24+
self::assertIsInt( $category_id );
2525

2626
$post_ids = $factory->post->create_many( 10 );
2727
foreach ( $post_ids as $post_id ) {
28-
assert( is_int( $post_id ) );
29-
assert( is_array( wp_set_post_categories( $post_id, array( $category_id ) ) ) );
28+
self::assertIsInt( $post_id );
29+
self::assertIsArray( wp_set_post_categories( $post_id, array( $category_id ) ) );
3030
}
3131
}
3232

0 commit comments

Comments
 (0)