Roughly chop 1 fennel bulb and blitz in a food processor to a purée. Add the garlic, basil, pine nuts, almonds, parmesan, juice of 1 lemon and 1 tbsp oil and blend until smooth and creamy.
Stuff three-quarters of the pesto under the skin of the chicken thighs and arrange on a tray. Add 2 tbsp oil to the rest of the pesto to loosen it, brush over the chicken and cover with cling film. Marinate in the fridge for 2 hours.
Preheat the oven to 200°C, gas mark 6 and grease an ovenproof dish.
Put the lemon zest, remaining juice and oil in a bowl and whisk to combine.
Cut the remaining fennel into wedges and put in the ovenproof dish along with the beans. Pour over the lemon oil, tossing to coat.
Place the chicken thighs on top and roast in the oven for 30-35 minutes, until the chicken is cooked through and the fennel and beans are tender.