Heat the oil in a frying pan over a medium heat. Add the onion and fry for about 5 minutes, stirring occasionally, until soft and translucent. Add the garlic and mushrooms and cook for another 2 minutes.
Remove the pan from the heat and stir in the flour. Slowly add the stock, a little at a time, and stir until well mixed. Return the pan to the heat and bring to the boil, stirring until thick and smooth.
Stir in the cooked chicken and parsley. Season with salt and pepper. Mix well, then put in a 1.2 litre (2 pint) pie dish or similar-sized ovenproof dish.
Roll out the pastry on a lightly floured surface to a shape just larger than the dish and put it over the pie. Brush the edge of the pie dish with beaten egg, add the pastry lid, press on to the dish edge then trim any excess pastry. Push down the edges to seal, crimping the edges with a finger and a small knife. Using a sharp knife, decorate the top of the pastry with crisscross lines, brush with the beaten egg and bake in a preheated oven, 200°C (400°F), Gas Mark 6, for 30 minutes until the pastry is puffed and golden brown.