#34277 closed defect (bug) (fixed)
factory not setup correctly in unit test in test_validate_date_values_should_process_array_value_for_year
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Build/Test Tools | Keywords: | |
Focuses: | Cc: |
Description
In the unit test "test_validate_date_values_should_process_array_value_for_year"two posts are made inorder to do a query on them for the test but the post_date a set wrongly as "get_gmt_from_date()" needs the date passed to be in the format of 'Y-m-d H:i:s' inorder to mnatch the internal regex if the get_option( 'timezone_string' ); returns false
There are 2 ways to fix this pass the full date (as patched) or to set update_option( 'timezone_string', 'Europe/London' ); before calling the factory or change get_gmt_from_date() to work with incomplete dates
Attachments (1)
Change History (4)
#1
@
9 years ago
- Milestone changed from Awaiting Review to 4.4
- Owner set to SergeyBiryukov
- Status changed from new to accepted
In my testing, post_date
was correct and the test passed, but a var_dump()
of posts revealed that post_date_gmt
and post_modified_gmt
were 1970-01-01 00:00:00
.
34277.patch looks good.
I've reviewed all the other instances of using the factory, and the date format is correct there.
set dates for factory to full format