Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions phpunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ def run(self, folder, configfile, testfile='', classname=''):
# remove the folder from the configfile
if configfile.startswith(folder):
configfile = configfile[len(folder):]
if configfile[0] == "/":
if configfile[0] == os.path.sep:
configfile = configfile[1:]

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

if os.path.isfile(os.path.join(folder, configfile)):
Expand Down Expand Up @@ -830,10 +830,13 @@ def is_enabled(self):
if not self.is_php_buffer():
return False
if self.is_test_buffer() or self.is_tests_buffer():
return False
path = self.find_test_file()
if path is None:
return False
path = self.find_tested_file()
if path is None:
return False
else:
path = self.find_test_file()
if path is None:
return False
self.file_to_open = path[0]
return True

Expand Down