Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit a4a19b8

Browse files
committed
Add a TODO for a failing WordPress PHPUnit test
1 parent ecb798f commit a4a19b8

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/wp-tests-phpunit-run.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const expectedFailures = [
4545
'Tests_Menu_Walker_Nav_Menu::test_start_el_with_empty_attributes with data set #6',
4646
'Tests_Menu_Walker_Nav_Menu::test_start_el_with_empty_attributes with data set #7',
4747
'Tests_Menu_wpNavMenu::test_wp_nav_menu_should_not_have_has_children_class_with_custom_depth',
48+
'WP_Test_REST_Posts_Controller::test_get_items_orderby_modified_query',
4849
];
4950

5051
console.log( 'Running WordPress PHPUnit tests with expected failures tracking...' );

wp-includes/sqlite-ast/class-wp-sqlite-driver.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3165,6 +3165,20 @@ private function cast_value_in_non_strict_mode(
31653165
case 'datetime':
31663166
case 'timestamp':
31673167
case 'year':
3168+
/*
3169+
* MySQL supports date and time components without a zero padding,
3170+
* but that doesn't work with date and time functions in SQLite.
3171+
* E.g.: "2025-3-7 9:5:2" is a valid datetime/timestamp value in
3172+
* in MySQL, but SQLite requires it to be "2025-03-07 09:05:02".
3173+
*
3174+
* A solution to this would need to be done on the SQL level to
3175+
* address computed values, and it should be done for the strict
3176+
* mode as well. This may require a user-defined function.
3177+
*
3178+
* TODO: Handle zero padding for date and time functions, while
3179+
* supporting both strict and non-strict modes.
3180+
*/
3181+
31683182
if ( 'date' === $mysql_data_type ) {
31693183
$function_call = sprintf( 'DATE(%s)', $translated_value );
31703184
} elseif ( 'time' === $mysql_data_type ) {

0 commit comments

Comments
 (0)