added phpunit to composer
fixed collection: added entity check in setEntities()