It could be with multiple calls of install_component(), but that would also require creating many files for style and its components. Doing that would require way more code than few simple queries that function does right now. It would also require different code for 3.0 and 3.1.

Why go through all that trouble for unit tests when few queries do the same?