My module defines a custom entity type and bundle and adds fields to the bundle programatically. Now, I need to create a bunch of dummy data to test the interface. I'm working with various combinations of entity_get_controller()->create(), entity_metadata_wrapper()->save(), field_attach_submit(), etc. and I have been able to fill the entity base table with new rows. The problem is that the generated entities aren't loaded with:
$query = new EntityFieldQuery(); $query->entityCondition('entity_type', 'my_entity_type');
I'm not surprised that the query doesn't return my new entities because I haven't found a place to specify bundle for the dummy entities and I haven't figured out how to generate default or random field data. How do I specify the bundle for my new entities and how can I generate valid random field data for date, taxonomy_term_reference and integer fields?