From 3594752e8ca92b23ee1d893d20f601e105a0119b Mon Sep 17 00:00:00 2001 From: Starli0n Date: Tue, 25 Nov 2014 18:12:41 +0100 Subject: [PATCH 1/2] Toggle between Class.php and ClassTest.php with one shortcut --- phpunit.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/phpunit.py b/phpunit.py index cfc9efd..937c701 100644 --- a/phpunit.py +++ b/phpunit.py @@ -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 From 08d997475558d80806173781ac44bbbdc9da234b Mon Sep 17 00:00:00 2001 From: Starli0n Date: Wed, 17 Feb 2016 19:02:02 +0100 Subject: [PATCH 2/2] Fix issue #60 --- phpunit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpunit.py b/phpunit.py index 937c701..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)):