Testing Rewrite Rules with PHPUnit

There are two problems here, a conceptual and practical

Conceptional: What is it that you are testing? If you are testing that your function actually inserts the rule into the set of rewrite rules, than you should just inspect the generated rewrite rules array (from the option probably). Anything beyond that is not “unit testing” and more of “integration testing”, something that have its place and can be done with phpunit, but it is not unit testing.

Practical: The wordpress unit test suit boots with ugly permalink setting, therefor no url parsing will happen at all. You will need to change the setting to any of the other permalink structures.
You might also want to use full urls, as parsing might try to match the site url first.