Usually the rule is you can't have a phone out of your pocket or backpack during a test. Students still have phones on them. If they disallowed that too, how would that work, an airport security style check going in?
They probably don't ask for phones upfront, but I don't see how that'd do anything. The only way to make this stricter would be to search students like they do for big standardized tests.
Students either leave phones at home, or the school provides pouches/mini lockers for each student.