stuartherbert / sublime-phpunit

PHPUnit Support for Sublime Text 2
https://github.com/stuartherbert/sublime-phpunit
Other
103 stars 20 forks source link

Leading path separator check failed under Windows #60

Open davisonja opened 9 years ago

davisonja commented 9 years ago

I'm using ST3 on Windows 7 and had some trouble with PHPUnit not picking up the files properly. I've ultimately traced it to the PhpunitCommand class with, for example,:

    # remove the folder from the configfile
    if configfile.startswith(folder):
        configfile = configfile[len(folder):]
        if configfile[0] == "/":
            configfile = configfile[1:]`

Which I replaced with

    # remove the folder from the configfile
    if configfile.startswith(folder):
        configfile = configfile[len(folder):]
        if configfile[0] == os.path.sep:
            configfile = configfile[1:]

which brought everything back into line. Am I the only one that's run into this? My phpunit.xml is buried under folders in the project, so it's not in the 'top folder', which I've seen people recommend...

Starli0n commented 8 years ago

Hi,

I am using ST2 on Win7 with PHPUnit 5.2.6 and I confirm the issue.

The fix works fine for me too, thank you @davisonja

It should also be applied to:

# remove the folder from the testfile