Preheat oven to 180 degrees C. Grease a quiche dish or tart tin and lightly dust with flour.
Roll out the pastry on a lightly floured surface and line the prepared quiche dish or tart tin, pressing down gently into the base and sides. Cut off any excess pastry and pinch the edges.
Warm the oil in a frying pan over a medium heat. Cook and stir the onions and garlic until soft. Sprinkle in the stock cube and season with salt and pepper. Mix well, remove from the heat and transfer to a bowl. In the same pan, cook and stir the mushrooms for 5 minutes until golden. Add to the onion mixture.
In a separate bowl, whisk eggs with cream and grated cheese. Add to onion mixture and mix well then pour into the prepared pastry case.
Bake in preheated oven for 40 minutes, until set in centre. Remove from the oven and serve warm.