This can more simply expressed by using `assertContains()` and a search string. That would make the test shorter and remove the loop.