The expected order in product/product_list_latest_2_response is LOGAN_HAT_CODE, LOGAN_MUG_CODE. The order in the database should be equal to the fixtures; smallest id is LOGAN_MUG_CODE and largest is LOGAN_SHOES_CODE.
So in general I see here two issues: One for Sylius and one for this plugin. Regarding the plugin I would say the fixtures should set the created_at explicitly. Something like:
The expected order in
product/product_list_latest_2_response
isLOGAN_HAT_CODE
,LOGAN_MUG_CODE
. The order in the database should be equal to the fixtures; smallest id isLOGAN_MUG_CODE
and largest isLOGAN_SHOES_CODE
.As far as I know
created_at
is usingdatetime
which currently lacks of supporting milliseconds (https://github.com/doctrine/doctrine2/issues/6305). Thus theORDER BY
in https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php#L140 depends on the DBMS implementation when all values increated_at
are the same.So in general I see here two issues: One for Sylius and one for this plugin. Regarding the plugin I would say the fixtures should set the
created_at
explicitly. Something like: