Description
Once WP changed the default theme to Twenty Sixteen, several of our tests began failing because Twenty Sixteen includes support for a soft-cropped 'post-thumbnail' image size.
See: https://core.trac.wordpress.org/ticket/34790
There are a few ways we can fix these tests. The first, which you can see in this patch to the original ticket, is to loop through all the defined image sizes and assume they will be included in expected srcset
attributes.
Another, is to unhook the theme setup functions for Twenty Sixteen before our tests run, which is how the Customizer tests work, see Konstantin's comment here: https://core.trac.wordpress.org/ticket/34790#comment:3
The other thing we can do is mock the data we want to use in our tests rather than using a real upload.