Specify date fixture and fix expectations #913
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test passes if the current date is during October - December (10-12), but fails for January - September (1-9)
In the test
Magento\Framework\Data\Form\Element\DateTest::testGetValue()
the expected format for the month part for the formatMagento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT
is specifíed asm
which is the placeholder for "Numeric representation of a month, with leading zeros".However, in the file
vendor/magento/zendframework1/library/Zend/Locale/Data/en.xml
the code for the month part matching the FORMAT_TYPE_SHORT isM
.According to the Zend Framework manual, this placeholder stands for "Month (Number of the month, one or two digits)".
(That placeholder value
M
is represented by the class constantZend_Date::MONTH_SHORT
).So the month values are expected to have a leading zero, but Zend_Date formats them without the leading zero.