(a) Except as otherwise provided by Subsection (b), the husband of a wife who gives birth to a child by means of assisted reproduction may not challenge his paternity of the child unless:
(1) before the fourth anniversary of the date of learning of the birth of the child he commences a proceeding to adjudicate his paternity; and
(2) the court finds that he did not consent to the assisted reproduction before or after the birth of the child.
(b) A proceeding to adjudicate paternity may be maintained at any time if the court determines that:
(1) the husband did not provide sperm for or, before or after the birth of the child, consent to assisted reproduction by his wife;
(2) the husband and the mother of the child have not cohabited since the probable time of assisted reproduction; and
(3) the husband never openly treated the child as his own.
(c) The limitations provided by this section apply to a marriage declared invalid after assisted reproduction.