Melt butter in a small heavy saucepan or skillet.
Add onions, cover, and cook slowly until tender and lightly colored, about 20 minutes.
Add .garlic, salt and pepper, and cook, uncovered, for another 5 minutes.
Remove from heat.
Rinse canned beans and drain them well.
Combine beans, onion-and-butter mixture and basil puree in the bowl of a food processor fitted with a steel blade, and process until smooth.
Add whole egg and egg yolk and process again until eggs are completely incorporated.
Taste, correct seasoning if necessary, scrape out into a bowl, cover and refrigerate until chilled.