Bring a medium pot of water to a boil. Add the corn kernels and blanch for 1 min. Scoop out the corn with a strainer; set aside. Season the water with a generous amount of salt, let it return to a boil, add the beans, and cook until just tender, about 3 min. Drain the beans and spread them on a baking sheet to cool.
Meanwhile, put the onion in a small bowl filled with ice water (which will crisp it and mellow its flavor). Using a mortar and pestle or the flat side of a chef's knife, mash the garlic to a paste with a pinch of salt. Put the paste in a small bowl (or keep it in the mortar) and whisk in the vinegar. Let sit for 5 to 10 minutes and then whisk in the olive oil.
Just before serving, drain the onions. Put the beans, corn, onions, cherry tomatoes, and basil in a large bowl. Season with salt and pepper and toss with the vinaigrette. Taste again and add more salt, pepper, or vinegar if needed. Serve right away.