diff --git a/phpunit.py b/phpunit.py index cfc9efd..6177ca2 100644 --- a/phpunit.py +++ b/phpunit.py @@ -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)): @@ -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