Preheat the oven to 220C/200C Fan/Gas 7.
Place a griddle over a medium–high heat. Brush the aubergine slices generously with olive oil and season lightly on both sides. Cook on the griddle until tender and charred, turning halfway though. You may need to do this in batches.
Unroll the pastry and place onto a large non-stick baking tray. Using a small knife, score a 1cm/½in border around the edge of the pastry and prick the base to prevent it from puffing up. Brush the border with beaten egg.
Mix the tomato paste, garlic and dried basil in a small bowl and spread over the base, avoiding the border. Lay the aubergine on top. Crumble the feta and sprinkle over the aubergines. Bake on the middle shelf for 25–30 minutes, or until the sides have puffed up and the pastry has cooked through. Allow to stand for 10 minutes.
Meanwhile make the salad. Carefully place the cloves on the edge of a small gas hob and turn the flame on to its lowest setting so the edges catch and the garlic turns black. Turn off the gas, let the garlic cool slightly, chop the cloves as finely as possible and crush using the back of a knife.
Place the garlic, oil, vinegar, mayonnaise and a pinch of salt in a lidded jar and shake until smooth.
Place the leaves, onion and pine nuts in a large bowl and drizzle over the dressing. (Any leftover dressing can be refrigerated.)
To serve, cut the tart into four to six slices and serve with the salad. Sprinkle over the fresh basil and finish with a drizzle of olive oil.