rcarriga / vim-ultest

The ultimate testing plugin for (Neo)Vim
MIT License
385 stars 15 forks source link

Feature/phpunit #95

Closed megawubs closed 1 year ago

megawubs commented 2 years ago

As mentioned in https://github.com/rcarriga/vim-ultest/issues/94 there is no parser for phpunit. This PR adds one.

My python is quite rusty. I've found out most of the stuff that needed to be done by looking around in the code. Only one thing that's unclear to me is that the namespaces array of the ParseResult is empty, while i've added a capturing group for it in the regex. I might have overlooked something. @rcarriga can you help out with this?

rcarriga commented 2 years ago

Thanks for the PR :grin: Just the one comment/question, looks great!

megawubs commented 2 years ago

@rcarriga What do you think so far?

rcarriga commented 2 years ago

Actually just looking at the vim-test code, it seems like vim-test doesn't use namespaces for phpunit so actually I believe the namespaces shouldn't be added. Otherwise the results won't be matched to the tests. So then the pattern should be

    "php#phpunit": OutputPatterns(
        failed_test=r"\s*\d\) .*::(?P<name>.*)",
    ),

I don't have a php environment to use so I'll have to ask you to verify,