A former Ecuadorean judge testified on Wednesday that he ghost-wrote rulings for a judge who ordered Chevron Corp to pay $19 billion to villagers whose land had been polluted by oil exploration.