How do I assert for a link's href AND link text in a functional test? In a functional test, I can use WebAssert::linkByHrefExists() to check that a link with a specific href exists on the page. And I can use WebAssert::linkExists() to check that a link with a specific link text exists on the page.

But there's no guarantee that these two will find the same link! How do I check that a link on the page has the expected href AND text?
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.