This is direct from DFPS's website:
CPS only removes children when it is necessary to protect them from abuse or neglect. This happens when there are no reasonable efforts that will keep children safe in their homes. With a court order, CPS can remove children when they are unsafe and the family is unable to make the changes needed to keep them safe. Depending on what is going on with the family, CPS may get a court order to remove children or it may remove children before getting a court order.
If CPS removes your child from your care without a court order, the court will review the case the next working day. In all cases, a judge will schedule a hearing within two weeks after CPS removes a child. When CPS removes children it will ask the parents to complete a Child Caregiver Resource Form. This form gives CPS the names of at least three people, including grandparents and other adult relatives, who might provide care, emotional support, or other support for the child while the parents receive services.
So as you can see, the department cannot take children away without a court order unless there is an emergency.
Unfortunately, in custody disputes, it is not uncommon for a parent to call DFPS.
The department cannot compel a drug test (a verbal consent can later be revoked) absent a court order. However, if the parent refuses consent, and the department feels that there is any concern (and sometimes when no concern) they will proceed with attempting to secure a legal court order.
It can be analogized to a police officer requesting entrance to a home without a warrant; most attorneys will advise the homeowner to refuse the request until a warrant is obtained.
Here is more information on how the department conducts their proceedings: https://www.dfps.state.tx.us/Child_Protection/About_Child_Protective_Services/parentguide.asp - for example, parents can agree to a safety plan - this is entirely voluntary; it is best to have an attorney to oversee any communications to help avoid a party from waiving their rights or making incriminatory statements.