WordPress.org

Make WordPress Core

Ticket #39265: query.php_fixed_test.patch

File query.php_fixed_test.patch, 1.6 KB (added by patopaiar, 7 months ago)
  • date/query.php

     
    222222
    223223                $found = $q->get_compare(
    224224                        array(
    225                                 'compare' => 'BETWEEN',
     225                                'compare' => 'NOT BETWEEN',
    226226                        )
    227227                );
    228                 $this->assertSame( 'BETWEEN', $found );
     228                $this->assertSame( 'NOT BETWEEN', $found );
    229229        }
    230230
    231231        public function test_validate_column_post_date() {
     
    524524                $found = $q->build_mysql_datetime( $datetime, $default_to_max );
    525525
    526526                $message = "Expected {$expected}, got {$found}";
    527                 $this->assertEquals( strtotime( $expected ), strtotime( $found ), $message, 10 );
     527                $this->assertEqualsWithDelta( strtotime( $expected ), strtotime( $found ), 10, $message );
    528528        }
    529529
    530530        public function mysql_datetime_input_provider() {
     
    559559                $found = $q->build_mysql_datetime( $datetime, $default_to_max );
    560560
    561561                $message = "Expected {$expected}, got {$found}";
    562                 $this->assertEquals( strtotime( $expected ), strtotime( $found ), $message, 10 );
     562                $this->assertEqualsWithDelta( strtotime( $expected ), strtotime( $found ), 10, $message );
    563563
    564564        }
    565565
     
    583583                $found     = $q->build_mysql_datetime( '-1 day' );
    584584
    585585                $message = "Expected {$expected}, got {$found}";
    586                 $this->assertEquals( strtotime( $expected ), strtotime( $found ), $message, 10 );
     586                $this->assertEqualsWithDelta( strtotime( $expected ), strtotime( $found ), 10, $message );
    587587        }
    588588
    589589        public function test_build_time_query_insufficient_time_values() {
     
    11331133                $columns[] = 'my_custom_column';
    11341134                return $columns;
    11351135        }
    1136 }
     1136}
     1137 No newline at end of file