Skip to content

Commit

Permalink
Menus: Fix linting errors introduced in [50013].
Browse files Browse the repository at this point in the history
Props TimothyBlynJacobs.
Fixes #52189.



git-svn-id: https://develop.svn.wordpress.org/trunk@50014 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
pento committed Jan 25, 2021
1 parent 6840112 commit ee4c2cf
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/phpunit/tests/post/nav-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,8 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-status' => 'publish',
)
);
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( date( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );

$menu_item_id = wp_update_nav_menu_item(
$this->menu_id,
Expand All @@ -1036,7 +1036,7 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date-gmt' => $post_date_gmt,
)
);
$post = get_post( $menu_item_id );
$post = get_post( $menu_item_id );
$this->assertEquals( get_date_from_gmt( $post_date_gmt ), $post->post_date );

$menu_item_id = wp_update_nav_menu_item(
Expand All @@ -1050,7 +1050,7 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date-gmt' => $invalid_date,
)
);
$post = get_post( $menu_item_id );
$post = get_post( $menu_item_id );
$this->assertEquals( '1970-01-01 00:00:00', $post->post_date );

$menu_item_id = wp_update_nav_menu_item(
Expand All @@ -1064,7 +1064,7 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date' => $post_date,
)
);
$post = get_post( $menu_item_id );
$post = get_post( $menu_item_id );
$this->assertEquals( $post_date, $post->post_date );

$menu_item_id = wp_update_nav_menu_item(
Expand All @@ -1079,7 +1079,7 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date-gmt' => $post_date_gmt,
)
);
$post = get_post( $menu_item_id );
$post = get_post( $menu_item_id );
$this->assertEquals( $post_date, $post->post_date );

$menu_item_id = wp_update_nav_menu_item(
Expand All @@ -1094,7 +1094,7 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date-gmt' => $invalid_date,
)
);
$post = get_post( $menu_item_id );
$post = get_post( $menu_item_id );
$this->assertEquals( $post_date, $post->post_date );

$menu_item_id = wp_update_nav_menu_item(
Expand All @@ -1108,8 +1108,8 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date' => $invalid_date,
)
);
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( date( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );

$menu_item_id = wp_update_nav_menu_item(
$this->menu_id,
Expand All @@ -1123,8 +1123,8 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date-gmt' => $post_date_gmt,
)
);
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( date( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );

$menu_item_id = wp_update_nav_menu_item(
$this->menu_id,
Expand All @@ -1138,7 +1138,7 @@ function test_wp_update_nav_menu_item_with_post_date() {
'menu-item-post-date-gmt' => $invalid_date,
)
);
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( date( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );
$post = get_post( $menu_item_id );
$this->assertEqualsWithDelta( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' );
}
}

0 comments on commit ee4c2cf

Please sign in to comment.