Cut the mushrooms in halves and then in slices. Heat 2 tbsp of vegetable oil in a pan and add finely chopped onion. Cook for a few minutes until it gets soft and transparent. Then add the sliced mushrooms and cook until the liquid is gone and mushrooms are browned. Add the spinach (defrosted, water squeezed out) and cook for a few minutes more. Add salt and pepper and leave to cool down.
Whisk the eggs well, add cream and mix it in. Add ham chopped in small cubes and the mushrooms and spinach. Mix everything together.
Divide the mixture in a muffin baking tray. Don't fill the cups to the top: leave a bit of space for them to rise. Sprinkle the grated cheddar cheese on top of each muffin. Bake in the oven at 375℉ for about 20 minutes. The muffins will rise quite a lot. You can test with a wooden toothpick whether they are completely cooked: stick it in the middle of a cupcake, it should come out clean. When you take the cupcakes out of the oven, they will slowly collapse, but this is alright. Serve hot or cold with fresh bread.