Assert that the URL's current hash fragment matches the given fragment:
$browser->assertFragmentIs('anchor');