How to apply a patch for a Drupal module?
This patch also exists at this #1063434 - the original issue for the test you reference above. One easy way to apply this patch would be to use the Drush Issue Queue commands.

Install with:

drush dl drush_iq


Then use it like this:

cd /path/to/drupal/root
drush am 1063434-#40


Presto!  Patch applied! Then drush-iq will work even better if you check out the module from git (i.e. drush dl field_collection --package-handler=git_drupalorg).

If you don't want to use drush-iq, try:

cd /path/to/drupal/root/sites/all/modules/field_collection
wget http://drupal.org/files/field_collection-feeds_integration-1063434-40.patch
patch -Np1 &lt; field_collection-feeds_integration-1063434-40.patch