This naming is pretty weird. the body of the while loop is not a test. IMO, this node should accept 2 nodes as arguments: the node for the condition and the node for the body.

The ``if`` node is indeed using a node with tests as argument, but this is because it can have several conditions with a different body for each of them (when using ``elseif``).
See the ``for`` tag for instance, which accepts ``ifExpr`` (for the filtering condition) and ``body``: https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/For.php#L22