Fix StateStoreageTest and sorting in DoctrineSQLSource