Please add comments, and a Behat test to verify the logic.