How do I assert for a link's href AND link text in a functional test?
Perhaps a better approach will be assert by XPath selector \Drupal\Tests\BrowserTestBase::xpath something like '//a[@href="' . $url .'"][contains(text()=\'Some text\')]' as XPath. Check this post about matching text and this about matching url.