British prime minister testifies on phone hacking scandal