
Scholars asked: Is a man who has tefillin on his head and his arm allowed to urinate in the bathroom? Rav Ada permitted this and Rav Matana forbade it.
Another rabbi, named Rava, was asked, and he answered: One is forbidden to urinate in the bathroom while wearing tefillin, lest he suddenly need to defecate or pass gas, for one is forbidden to even pass gas while wearing tefillin. But in the field one is permitted to urinate while wearing tefillin.
(Babylonian Talmud, Tractate Berachot 23a)